OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ |
6 #define CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ | 6 #define CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 IN_PROC_BROWSER_TEST_F(x, y) { ASSERT_TRUE(RunJavascriptTest(#y)); } | 32 IN_PROC_BROWSER_TEST_F(x, y) { ASSERT_TRUE(RunJavascriptTest(#y)); } |
33 | 33 |
34 // The runner of WebUI javascript based tests. | 34 // The runner of WebUI javascript based tests. |
35 // See chrome/test/data/webui/test_api.js for the javascript side test API's. | 35 // See chrome/test/data/webui/test_api.js for the javascript side test API's. |
36 // | 36 // |
37 // These tests should follow the form given in: | 37 // These tests should follow the form given in: |
38 // chrome/test/data/webui/sample_downloads.js. | 38 // chrome/test/data/webui/sample_downloads.js. |
39 // and the lone test within this class. | 39 // and the lone test within this class. |
40 class WebUIBrowserTest : public JavaScriptBrowserTest { | 40 class WebUIBrowserTest : public JavaScriptBrowserTest { |
41 public: | 41 public: |
42 virtual ~WebUIBrowserTest(); | 42 ~WebUIBrowserTest() override; |
43 | 43 |
44 // Runs a javascript function in the context of all libraries. | 44 // Runs a javascript function in the context of all libraries. |
45 // Note that calls to functions in test_api.js are not supported. | 45 // Note that calls to functions in test_api.js are not supported. |
46 // Takes ownership of Value* arguments. | 46 // Takes ownership of Value* arguments. |
47 bool RunJavascriptFunction(const std::string& function_name); | 47 bool RunJavascriptFunction(const std::string& function_name); |
48 bool RunJavascriptFunction(const std::string& function_name, | 48 bool RunJavascriptFunction(const std::string& function_name, |
49 base::Value* arg); | 49 base::Value* arg); |
50 bool RunJavascriptFunction(const std::string& function_name, | 50 bool RunJavascriptFunction(const std::string& function_name, |
51 base::Value* arg1, | 51 base::Value* arg1, |
52 base::Value* arg2); | 52 base::Value* arg2); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 std::string preload_test_name_; | 155 std::string preload_test_name_; |
156 | 156 |
157 // When this is non-NULL, this is The WebUI instance used for testing. | 157 // When this is non-NULL, this is The WebUI instance used for testing. |
158 // Otherwise the selected tab's web_ui is used. | 158 // Otherwise the selected tab's web_ui is used. |
159 content::WebUI* override_selected_web_ui_; | 159 content::WebUI* override_selected_web_ui_; |
160 | 160 |
161 scoped_ptr<TestChromeWebUIControllerFactory> test_factory_; | 161 scoped_ptr<TestChromeWebUIControllerFactory> test_factory_; |
162 }; | 162 }; |
163 | 163 |
164 #endif // CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ | 164 #endif // CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ |
OLD | NEW |