Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_TEST_BASE_JAVASCRIPT_BROWSERTEST_H_ | |
| 6 #define CHROME_TEST_BASE_JAVASCRIPT_BROWSERTEST_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_vector.h" | |
| 9 #include "base/strings/string16.h" | |
| 10 #include "base/values.h" | |
| 11 #include "chrome/test/base/in_process_browser_test.h" | |
| 12 | |
| 13 class JavaScriptBrowserTest : public InProcessBrowserTest { | |
|
Peter Lundblad
2014/06/08 23:27:22
Documentation?
David Tseng
2014/06/10 05:35:22
Done.
| |
| 14 public: | |
| 15 static const base::FilePath::CharType kA11yAuditLibraryJSPath[]; | |
| 16 static const base::FilePath::CharType kMockJSPath[]; | |
| 17 static const base::FilePath::CharType kWebUILibraryJS[]; | |
| 18 static const base::FilePath::CharType kWebUITestFolder[]; | |
|
Peter Lundblad
2014/06/08 23:27:22
Are these statics used by anything or could they b
David Tseng
2014/06/10 05:35:22
They're used by some of the print preview tests I
| |
| 19 | |
| 20 typedef ScopedVector<const base::Value> ConstValueVector; | |
| 21 JavaScriptBrowserTest() {} | |
| 22 virtual ~JavaScriptBrowserTest() {} | |
| 23 | |
| 24 // Add a custom helper JS library for your test. | |
| 25 // If a relative path is specified, it'll be read | |
| 26 // as relative to the test data dir. | |
| 27 void AddLibrary(const base::FilePath& library_path); | |
| 28 | |
| 29 protected: | |
| 30 void SetUpOnMainThread(); | |
|
Peter Lundblad
2014/06/08 23:27:22
OVERRIDE
David Tseng
2014/06/10 05:35:22
Done.
| |
| 31 | |
| 32 // Builds a vector of strings of all added javascript libraries suitable for | |
| 33 // execution by subclasses. | |
| 34 void BuildJavascriptLibraries(std::vector<base::string16>* libraries); | |
| 35 | |
| 36 // Builds a string with a call to the runTest JS function, passing the | |
| 37 // given |is_async|, |test_name| and its |args|. | |
| 38 // This is then suitable for execution by subclasses in a | |
| 39 // |RunJavaScriptBrowserTestF| | |
| 40 // call. | |
|
dmazzoni
2014/06/09 06:59:46
nit: fits on previous line
David Tseng
2014/06/10 05:35:22
Done.
| |
| 41 base::string16 BuildRunTestJSCall(bool is_async, | |
| 42 const std::string& test_name, | |
| 43 const ConstValueVector& args); | |
| 44 | |
| 45 private: | |
| 46 // User added libraries. | |
| 47 std::vector<base::FilePath> user_libraries_; | |
| 48 | |
| 49 // User library search paths. | |
| 50 std::vector<base::FilePath> library_search_paths_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(JavaScriptBrowserTest); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_TEST_BASE_JAVASCRIPT_BROWSERTEST_H_ | |
| OLD | NEW |