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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 54 |
55 // Add a helper JS library from a string path. | |
56 // The path is interpreted relative to base::DIR_SOURCE_ROOT. | |
57 void AddLibraryFromUTFPath(const std::string path); | |
Sheridan Rawlins
2012/12/18 01:43:35
Can this take a FilePath? Why a string?
| |
58 | |
55 // Runs a javascript function in the context of all libraries. | 59 // Runs a javascript function in the context of all libraries. |
56 // Note that calls to functions in test_api.js are not supported. | 60 // Note that calls to functions in test_api.js are not supported. |
57 // Takes ownership of Value* arguments. | 61 // Takes ownership of Value* arguments. |
58 bool RunJavascriptFunction(const std::string& function_name); | 62 bool RunJavascriptFunction(const std::string& function_name); |
59 bool RunJavascriptFunction(const std::string& function_name, | 63 bool RunJavascriptFunction(const std::string& function_name, |
60 base::Value* arg); | 64 base::Value* arg); |
61 bool RunJavascriptFunction(const std::string& function_name, | 65 bool RunJavascriptFunction(const std::string& function_name, |
62 base::Value* arg1, | 66 base::Value* arg1, |
63 base::Value* arg2); | 67 base::Value* arg2); |
64 bool RunJavascriptFunction(const std::string& function_name, | 68 bool RunJavascriptFunction(const std::string& function_name, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 // PreloadJavascriptLibraries(). | 198 // PreloadJavascriptLibraries(). |
195 std::string preload_test_fixture_; | 199 std::string preload_test_fixture_; |
196 std::string preload_test_name_; | 200 std::string preload_test_name_; |
197 | 201 |
198 // When this is non-NULL, this is The WebUI instance used for testing. | 202 // When this is non-NULL, this is The WebUI instance used for testing. |
199 // Otherwise the selected tab's web_ui is used. | 203 // Otherwise the selected tab's web_ui is used. |
200 content::WebUI* override_selected_web_ui_; | 204 content::WebUI* override_selected_web_ui_; |
201 }; | 205 }; |
202 | 206 |
203 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ | 207 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_BROWSERTEST_H_ |
OLD | NEW |