| 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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 13 #include "chrome/test/base/javascript_browser_test.h" | 13 #include "chrome/test/base/javascript_browser_test.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class Value; | 16 class Value; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class RenderViewHost; | 20 class RenderViewHost; |
| 21 class WebUI; | 21 class WebUI; |
| 22 class WebUIMessageHandler; | 22 class WebUIMessageHandler; |
| 23 } | 23 } |
| 24 | 24 |
| 25 class TestChromeWebUIControllerFactory; | 25 class TestChromeWebUIControllerFactory; |
| 26 class WebUITestHandler; | 26 class WebUITestHandler; |
| 27 | 27 |
| 28 class WebUILogMessageListener : logging::LogMessageListener { |
| 29 public: |
| 30 void OnMessage(int severity, const char* file, int line, |
| 31 size_t message_start, const std::string& str) override; |
| 32 }; |
| 33 |
| 28 // The runner of WebUI javascript based tests. | 34 // The runner of WebUI javascript based tests. |
| 29 // 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. |
| 30 // | 36 // |
| 31 // These tests should follow the form given in: | 37 // These tests should follow the form given in: |
| 32 // chrome/test/data/webui/sample_downloads.js. | 38 // chrome/test/data/webui/sample_downloads.js. |
| 33 // and the lone test within this class. | 39 // and the lone test within this class. |
| 34 class WebUIBrowserTest : public JavaScriptBrowserTest { | 40 class WebUIBrowserTest : public JavaScriptBrowserTest { |
| 35 public: | 41 public: |
| 36 ~WebUIBrowserTest() override; | 42 ~WebUIBrowserTest() override; |
| 37 | 43 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Saves the states of |test_fixture| and |test_name| for calling | 152 // Saves the states of |test_fixture| and |test_name| for calling |
| 147 // PreloadJavascriptLibraries(). | 153 // PreloadJavascriptLibraries(). |
| 148 std::string preload_test_fixture_; | 154 std::string preload_test_fixture_; |
| 149 std::string preload_test_name_; | 155 std::string preload_test_name_; |
| 150 | 156 |
| 151 // 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. |
| 152 // Otherwise the selected tab's web_ui is used. | 158 // Otherwise the selected tab's web_ui is used. |
| 153 content::WebUI* override_selected_web_ui_; | 159 content::WebUI* override_selected_web_ui_; |
| 154 | 160 |
| 155 std::unique_ptr<TestChromeWebUIControllerFactory> test_factory_; | 161 std::unique_ptr<TestChromeWebUIControllerFactory> test_factory_; |
| 162 |
| 163 WebUILogMessageListener log_listener_; |
| 156 }; | 164 }; |
| 157 | 165 |
| 158 #endif // CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ | 166 #endif // CHROME_TEST_BASE_WEB_UI_BROWSER_TEST_H_ |
| OLD | NEW |