| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // HeadlessWebContentsObserver implementation: | 110 // HeadlessWebContentsObserver implementation: |
| 111 void DevToolsTargetReady() override; | 111 void DevToolsTargetReady() override; |
| 112 void RenderProcessExited(base::TerminationStatus status, | 112 void RenderProcessExited(base::TerminationStatus status, |
| 113 int exit_code) override; | 113 int exit_code) override; |
| 114 | 114 |
| 115 // Implemented by tests and used to send request(s) to DevTools. Subclasses | 115 // Implemented by tests and used to send request(s) to DevTools. Subclasses |
| 116 // need to ensure that FinishAsynchronousTest() is called after response(s) | 116 // need to ensure that FinishAsynchronousTest() is called after response(s) |
| 117 // are processed (e.g. in a callback). | 117 // are processed (e.g. in a callback). |
| 118 virtual void RunDevTooledTest() = 0; | 118 virtual void RunDevTooledTest() = 0; |
| 119 | 119 |
| 120 // Returns the protocol handlers to construct the browser with. By default |
| 121 // the map returned is empty. |
| 122 virtual ProtocolHandlerMap GetProtocolHandlers(); |
| 123 |
| 120 protected: | 124 protected: |
| 121 void RunTest(); | 125 void RunTest(); |
| 122 | 126 |
| 123 HeadlessBrowserContext* browser_context_; // Not owned. | 127 HeadlessBrowserContext* browser_context_; // Not owned. |
| 124 HeadlessWebContents* web_contents_; | 128 HeadlessWebContents* web_contents_; |
| 125 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; | 129 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; |
| 126 bool render_process_exited_; | 130 bool render_process_exited_; |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 } // namespace headless | 133 } // namespace headless |
| 130 | 134 |
| 131 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ | 135 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ |
| OLD | NEW |