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_JAVASCRIPT_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ |
6 #define CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ | 6 #define CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // If a relative path is specified, it'll be read | 24 // If a relative path is specified, it'll be read |
25 // as relative to the test data dir. | 25 // as relative to the test data dir. |
26 void AddLibrary(const base::FilePath& library_path); | 26 void AddLibrary(const base::FilePath& library_path); |
27 | 27 |
28 protected: | 28 protected: |
29 JavaScriptBrowserTest(); | 29 JavaScriptBrowserTest(); |
30 | 30 |
31 virtual ~JavaScriptBrowserTest(); | 31 virtual ~JavaScriptBrowserTest(); |
32 | 32 |
33 // InProcessBrowserTest overrides. | 33 // InProcessBrowserTest overrides. |
34 virtual void SetUpOnMainThread() OVERRIDE; | 34 virtual void SetUpOnMainThread() override; |
35 | 35 |
36 // Builds a vector of strings of all added javascript libraries suitable for | 36 // Builds a vector of strings of all added javascript libraries suitable for |
37 // execution by subclasses. | 37 // execution by subclasses. |
38 void BuildJavascriptLibraries(std::vector<base::string16>* libraries); | 38 void BuildJavascriptLibraries(std::vector<base::string16>* libraries); |
39 | 39 |
40 // Builds a string with a call to the runTest JS function, passing the | 40 // Builds a string with a call to the runTest JS function, passing the |
41 // given |is_async|, |test_name| and its |args|. | 41 // given |is_async|, |test_name| and its |args|. |
42 // This is then suitable for execution by subclasses in a | 42 // This is then suitable for execution by subclasses in a |
43 // |RunJavaScriptBrowserTestF| call. | 43 // |RunJavaScriptBrowserTestF| call. |
44 base::string16 BuildRunTestJSCall(bool is_async, | 44 base::string16 BuildRunTestJSCall(bool is_async, |
45 const std::string& test_name, | 45 const std::string& test_name, |
46 const ConstValueVector& args); | 46 const ConstValueVector& args); |
47 | 47 |
48 private: | 48 private: |
49 // User added libraries. | 49 // User added libraries. |
50 std::vector<base::FilePath> user_libraries_; | 50 std::vector<base::FilePath> user_libraries_; |
51 | 51 |
52 // User library search paths. | 52 // User library search paths. |
53 std::vector<base::FilePath> library_search_paths_; | 53 std::vector<base::FilePath> library_search_paths_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(JavaScriptBrowserTest); | 55 DISALLOW_COPY_AND_ASSIGN(JavaScriptBrowserTest); |
56 }; | 56 }; |
57 | 57 |
58 #endif // CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ | 58 #endif // CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ |
OLD | NEW |