OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ | 5 #ifndef HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ |
6 #define HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ | 6 #define HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 public: | 53 public: |
54 // Notify that an asynchronous test is now complete and the test runner should | 54 // Notify that an asynchronous test is now complete and the test runner should |
55 // exit. | 55 // exit. |
56 void FinishAsynchronousTest(); | 56 void FinishAsynchronousTest(); |
57 | 57 |
58 protected: | 58 protected: |
59 HeadlessBrowserTest(); | 59 HeadlessBrowserTest(); |
60 ~HeadlessBrowserTest() override; | 60 ~HeadlessBrowserTest() override; |
61 | 61 |
62 // BrowserTestBase: | 62 // BrowserTestBase: |
63 void RunTestOnMainThreadLoop() override; | 63 void PreRunTestOnMainThread() override; |
64 void SetUpOnMainThread() override; | 64 void PostRunTestOnMainThread() override; |
65 void TearDownOnMainThread() override; | |
66 | 65 |
67 // Run an asynchronous test in a nested run loop. The caller should call | 66 // Run an asynchronous test in a nested run loop. The caller should call |
68 // FinishAsynchronousTest() to notify that the test should finish. | 67 // FinishAsynchronousTest() to notify that the test should finish. |
69 void RunAsynchronousTest(); | 68 void RunAsynchronousTest(); |
70 | 69 |
71 // Synchronously waits for a tab to finish loading. | 70 // Synchronously waits for a tab to finish loading. |
72 bool WaitForLoad(HeadlessWebContents* web_contents); | 71 bool WaitForLoad(HeadlessWebContents* web_contents); |
73 | 72 |
74 // Synchronously evaluates a script and returns the result. | 73 // Synchronously evaluates a script and returns the result. |
75 std::unique_ptr<runtime::EvaluateResult> EvaluateScript( | 74 std::unique_ptr<runtime::EvaluateResult> EvaluateScript( |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 128 |
130 HeadlessBrowserContext* browser_context_; // Not owned. | 129 HeadlessBrowserContext* browser_context_; // Not owned. |
131 HeadlessWebContents* web_contents_; | 130 HeadlessWebContents* web_contents_; |
132 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; | 131 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; |
133 bool render_process_exited_; | 132 bool render_process_exited_; |
134 }; | 133 }; |
135 | 134 |
136 } // namespace headless | 135 } // namespace headless |
137 | 136 |
138 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ | 137 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ |
OLD | NEW |