| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "content/public/browser/web_ui_message_handler.h" | 6 #include "content/public/browser/web_ui_message_handler.h" |
| 7 #include "content/public/test/test_web_ui.h" | 7 #include "content/public/test/test_web_ui.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool TestWebUI::HasRenderFrame() { | 46 bool TestWebUI::HasRenderFrame() { |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void TestWebUI::AddMessageHandler(WebUIMessageHandler* handler) { | 50 void TestWebUI::AddMessageHandler(WebUIMessageHandler* handler) { |
| 51 handlers_.push_back(handler); | 51 handlers_.push_back(handler); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool TestWebUI::CanCallJavascript() { |
| 55 return true; |
| 56 } |
| 57 |
| 54 void TestWebUI::CallJavascriptFunction(const std::string& function_name) { | 58 void TestWebUI::CallJavascriptFunction(const std::string& function_name) { |
| 55 call_data_.push_back(new CallData(function_name)); | 59 call_data_.push_back(new CallData(function_name)); |
| 56 } | 60 } |
| 57 | 61 |
| 58 void TestWebUI::CallJavascriptFunction(const std::string& function_name, | 62 void TestWebUI::CallJavascriptFunction(const std::string& function_name, |
| 59 const base::Value& arg1) { | 63 const base::Value& arg1) { |
| 60 call_data_.push_back(new CallData(function_name)); | 64 call_data_.push_back(new CallData(function_name)); |
| 61 call_data_.back()->TakeAsArg1(arg1.DeepCopy()); | 65 call_data_.back()->TakeAsArg1(arg1.DeepCopy()); |
| 62 } | 66 } |
| 63 | 67 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 110 |
| 107 void TestWebUI::CallData::TakeAsArg2(base::Value* arg) { | 111 void TestWebUI::CallData::TakeAsArg2(base::Value* arg) { |
| 108 arg2_.reset(arg); | 112 arg2_.reset(arg); |
| 109 } | 113 } |
| 110 | 114 |
| 111 void TestWebUI::CallData::TakeAsArg3(base::Value* arg) { | 115 void TestWebUI::CallData::TakeAsArg3(base::Value* arg) { |
| 112 arg3_.reset(arg); | 116 arg3_.reset(arg); |
| 113 } | 117 } |
| 114 | 118 |
| 115 } // namespace content | 119 } // namespace content |
| OLD | NEW |