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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // as relative to the test data dir. | 27 // as relative to the test data dir. |
28 void AddLibrary(const base::FilePath& library_path); | 28 void AddLibrary(const base::FilePath& library_path); |
29 | 29 |
30 protected: | 30 protected: |
31 JavaScriptBrowserTest(); | 31 JavaScriptBrowserTest(); |
32 | 32 |
33 ~JavaScriptBrowserTest() override; | 33 ~JavaScriptBrowserTest() override; |
34 | 34 |
35 // InProcessBrowserTest overrides. | 35 // InProcessBrowserTest overrides. |
36 void SetUpOnMainThread() override; | 36 void SetUpOnMainThread() override; |
| 37 void TearDownOnMainThread() override; |
37 | 38 |
38 // Builds a vector of strings of all added javascript libraries suitable for | 39 // Builds a vector of strings of all added javascript libraries suitable for |
39 // execution by subclasses. | 40 // execution by subclasses. |
40 void BuildJavascriptLibraries(std::vector<base::string16>* libraries); | 41 void BuildJavascriptLibraries(std::vector<base::string16>* libraries); |
41 | 42 |
42 // Builds a string with a call to the runTest JS function, passing the | 43 // Builds a string with a call to the runTest JS function, passing the |
43 // given |is_async|, |test_name| and its |args|. | 44 // given |is_async|, |test_name| and its |args|. |
44 // This is then suitable for execution by subclasses in a | 45 // This is then suitable for execution by subclasses in a |
45 // |RunJavaScriptBrowserTestF| call. | 46 // |RunJavaScriptBrowserTestF| call. |
46 base::string16 BuildRunTestJSCall(bool is_async, | 47 base::string16 BuildRunTestJSCall(bool is_async, |
47 const std::string& test_name, | 48 const std::string& test_name, |
48 const ConstValueVector& args); | 49 const ConstValueVector& args); |
49 | 50 |
| 51 bool has_console_errors() const; |
| 52 void set_has_console_errors(bool has_console_errors); |
| 53 |
| 54 bool has_console_info() const; |
| 55 void set_has_console_info(bool has_console_errors); |
| 56 |
50 private: | 57 private: |
51 // User added libraries. | 58 // User added libraries. |
52 std::vector<base::FilePath> user_libraries_; | 59 std::vector<base::FilePath> user_libraries_; |
53 | 60 |
54 // User library search paths. | 61 // User library search paths. |
55 std::vector<base::FilePath> library_search_paths_; | 62 std::vector<base::FilePath> library_search_paths_; |
56 | 63 |
57 DISALLOW_COPY_AND_ASSIGN(JavaScriptBrowserTest); | 64 DISALLOW_COPY_AND_ASSIGN(JavaScriptBrowserTest); |
58 }; | 65 }; |
59 | 66 |
60 #endif // CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ | 67 #endif // CHROME_TEST_BASE_JAVASCRIPT_BROWSER_TEST_H_ |
OLD | NEW |