1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38

content / public / test / web_contents_tester.cc [blame]

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/test/web_contents_tester.h"

#include <utility>

#include "content/test/test_web_contents.h"

namespace content {

namespace {

// The two subclasses here are instantiated via the deprecated
// CreateWebContentsFor... factories below.

}  // namespace

// static
WebContentsTester* WebContentsTester::For(WebContents* contents) {
  return static_cast<TestWebContents*>(contents);
}

// static
std::unique_ptr<WebContents> WebContentsTester::CreateTestWebContents(
    BrowserContext* browser_context,
    scoped_refptr<SiteInstance> instance) {
  return TestWebContents::Create(browser_context, std::move(instance));
}

// static
WebContents* WebContentsTester::CreateTestWebContents(
    const WebContents::CreateParams& params) {
  return TestWebContents::Create(params);
}

}  // namespace content