| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 : public InProcessBrowserTest, | 44 : public InProcessBrowserTest, |
| 45 public content::JsInjectionReadyObserver { | 45 public content::JsInjectionReadyObserver { |
| 46 public: | 46 public: |
| 47 typedef ScopedVector<const base::Value> ConstValueVector; | 47 typedef ScopedVector<const base::Value> ConstValueVector; |
| 48 virtual ~WebUIBrowserTest(); | 48 virtual ~WebUIBrowserTest(); |
| 49 | 49 |
| 50 // Add a custom helper JS library for your test. | 50 // Add a custom helper JS library for your test. |
| 51 // If a relative path is specified, it'll be read | 51 // If a relative path is specified, it'll be read |
| 52 // as relative to the test data dir. | 52 // as relative to the test data dir. |
| 53 void AddLibrary(const FilePath& library_path); | 53 void AddLibrary(const FilePath& library_path); |
| 54 void AddLibraryFromUTFPath(std::string path); |
| 54 | 55 |
| 55 // Runs a javascript function in the context of all libraries. | 56 // Runs a javascript function in the context of all libraries. |
| 56 // Note that calls to functions in test_api.js are not supported. | 57 // Note that calls to functions in test_api.js are not supported. |
| 57 // Takes ownership of Value* arguments. | 58 // Takes ownership of Value* arguments. |
| 58 bool RunJavascriptFunction(const std::string& function_name); | 59 bool RunJavascriptFunction(const std::string& function_name); |
| 59 bool RunJavascriptFunction(const std::string& function_name, | 60 bool RunJavascriptFunction(const std::string& function_name, |
| 60 base::Value* arg); | 61 base::Value* arg); |
| 61 bool RunJavascriptFunction(const std::string& function_name, | 62 bool RunJavascriptFunction(const std::string& function_name, |
| 62 base::Value* arg1, | 63 base::Value* arg1, |
| 63 base::Value* arg2); | 64 base::Value* arg2); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // PreloadJavascriptLibraries(). | 195 // PreloadJavascriptLibraries(). |
| 195 std::string preload_test_fixture_; | 196 std::string preload_test_fixture_; |
| 196 std::string preload_test_name_; | 197 std::string preload_test_name_; |
| 197 | 198 |
| 198 // When this is non-NULL, this is The WebUI instance used for testing. | 199 // When this is non-NULL, this is The WebUI instance used for testing. |
| 199 // Otherwise the selected tab's web_ui is used. | 200 // Otherwise the selected tab's web_ui is used. |
| 200 content::WebUI* override_selected_web_ui_; | 201 content::WebUI* override_selected_web_ui_; |
| 201 }; | 202 }; |
| 202 | 203 |
| 203 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ | 204 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ |
| OLD | NEW |