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"
10 TestWebUI::TestWebUI() {
13 TestWebUI::~TestWebUI() {
17 void TestWebUI::ClearTrackedCalls() {
21 WebContents
* TestWebUI::GetWebContents() const {
25 WebUIController
* TestWebUI::GetController() const {
29 float TestWebUI::GetDeviceScaleFactor() const {
33 const base::string16
& TestWebUI::GetOverriddenTitle() const {
37 ui::PageTransition
TestWebUI::GetLinkTransitionType() const {
38 return ui::PAGE_TRANSITION_LINK
;
41 int TestWebUI::GetBindings() const {
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
) {
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
) {
78 void TestWebUI::CallJavascriptFunction(
79 const std::string
& function_name
,
80 const std::vector
<const base::Value
*>& args
) {
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
) {
95 void TestWebUI::CallData::TakeAsArg2(base::Value
* arg
) {
99 } // namespace content