[Android WebView] Fix webview perf bot switchover to use org.chromium.webview_shell...
[chromium-blink-merge.git] / content / public / test / test_web_ui.cc
blobf3d5598e3fce0bc84b3ac00750d2c028addda224
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/logging.h"
6 #include "content/public/test/test_web_ui.h"
8 namespace content {
10 TestWebUI::TestWebUI() {
13 TestWebUI::~TestWebUI() {
14 ClearTrackedCalls();
17 void TestWebUI::ClearTrackedCalls() {
18 call_data_.clear();
21 WebContents* TestWebUI::GetWebContents() const {
22 return nullptr;
25 WebUIController* TestWebUI::GetController() const {
26 return nullptr;
29 float TestWebUI::GetDeviceScaleFactor() const {
30 return 1.0f;
33 const base::string16& TestWebUI::GetOverriddenTitle() const {
34 return temp_string_;
37 ui::PageTransition TestWebUI::GetLinkTransitionType() const {
38 return ui::PAGE_TRANSITION_LINK;
41 int TestWebUI::GetBindings() const {
42 return 0;
45 void TestWebUI::CallJavascriptFunction(const std::string& function_name) {
46 call_data_.push_back(new CallData(function_name));
49 void TestWebUI::CallJavascriptFunction(const std::string& function_name,
50 const base::Value& arg1) {
51 call_data_.push_back(new CallData(function_name));
52 call_data_.back()->TakeAsArg1(arg1.DeepCopy());
55 void TestWebUI::CallJavascriptFunction(const std::string& function_name,
56 const base::Value& arg1,
57 const base::Value& arg2) {
58 call_data_.push_back(new CallData(function_name));
59 call_data_.back()->TakeAsArg1(arg1.DeepCopy());
60 call_data_.back()->TakeAsArg2(arg2.DeepCopy());
63 void TestWebUI::CallJavascriptFunction(const std::string& function_name,
64 const base::Value& arg1,
65 const base::Value& arg2,
66 const base::Value& arg3) {
67 NOTREACHED();
70 void TestWebUI::CallJavascriptFunction(const std::string& function_name,
71 const base::Value& arg1,
72 const base::Value& arg2,
73 const base::Value& arg3,
74 const base::Value& arg4) {
75 NOTREACHED();
78 void TestWebUI::CallJavascriptFunction(
79 const std::string& function_name,
80 const std::vector<const base::Value*>& args) {
81 NOTREACHED();
84 TestWebUI::CallData::CallData(const std::string& function_name)
85 : function_name_(function_name) {
88 TestWebUI::CallData::~CallData() {
91 void TestWebUI::CallData::TakeAsArg1(base::Value* arg) {
92 arg1_.reset(arg);
95 void TestWebUI::CallData::TakeAsArg2(base::Value* arg) {
96 arg2_.reset(arg);
99 } // namespace content