| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const std::string& preload_test_name); | 88 const std::string& preload_test_name); |
| 89 | 89 |
| 90 // Called by javascript-generated test bodies to browse to a page and preload | 90 // Called by javascript-generated test bodies to browse to a page and preload |
| 91 // the javascript for the given |preload_test_fixture| and | 91 // the javascript for the given |preload_test_fixture| and |
| 92 // |preload_test_name|. chrome.send will be overridden to allow javascript | 92 // |preload_test_name|. chrome.send will be overridden to allow javascript |
| 93 // handler mocking. | 93 // handler mocking. |
| 94 void BrowsePrintPreload(const GURL& browse_to, | 94 void BrowsePrintPreload(const GURL& browse_to, |
| 95 const std::string& preload_test_fixture, | 95 const std::string& preload_test_fixture, |
| 96 const std::string& preload_test_name); | 96 const std::string& preload_test_name); |
| 97 | 97 |
| 98 // Runs a message loop until async test finishes. Returns the result of the |
| 99 // test. |
| 100 bool WaitForAsyncResult(); |
| 101 |
| 98 protected: | 102 protected: |
| 99 WebUIBrowserTest(); | 103 WebUIBrowserTest(); |
| 100 | 104 |
| 101 // Setup test path. | 105 // Setup test path. |
| 102 virtual void SetUpInProcessBrowserTestFixture(); | 106 virtual void SetUpInProcessBrowserTestFixture(); |
| 103 | 107 |
| 104 // Returns a mock WebUI object under test (if any). | 108 // Returns a mock WebUI object under test (if any). |
| 105 virtual WebUIMessageHandler* GetMockMessageHandler(); | 109 virtual WebUIMessageHandler* GetMockMessageHandler(); |
| 106 | 110 |
| 107 // Returns a file:// GURL constructed from |path| inside the test data dir for | 111 // Returns a file:// GURL constructed from |path| inside the test data dir for |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // again. | 152 // again. |
| 149 bool libraries_preloaded_; | 153 bool libraries_preloaded_; |
| 150 | 154 |
| 151 // Saves the states of |test_fixture| and |test_name| for calling | 155 // Saves the states of |test_fixture| and |test_name| for calling |
| 152 // PreloadJavascriptLibraries(). | 156 // PreloadJavascriptLibraries(). |
| 153 std::string preload_test_fixture_; | 157 std::string preload_test_fixture_; |
| 154 std::string preload_test_name_; | 158 std::string preload_test_name_; |
| 155 }; | 159 }; |
| 156 | 160 |
| 157 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ | 161 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ |
| OLD | NEW |