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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Implemented by tests and used to send request(s) to DevTools. Subclasses | 114 // Implemented by tests and used to send request(s) to DevTools. Subclasses |
115 // need to ensure that FinishAsynchronousTest() is called after response(s) | 115 // need to ensure that FinishAsynchronousTest() is called after response(s) |
116 // are processed (e.g. in a callback). | 116 // are processed (e.g. in a callback). |
117 virtual void RunDevTooledTest() = 0; | 117 virtual void RunDevTooledTest() = 0; |
118 | 118 |
119 // Returns the protocol handlers to construct the browser with. By default | 119 // Returns the protocol handlers to construct the browser with. By default |
120 // the map returned is empty. | 120 // the map returned is empty. |
121 virtual ProtocolHandlerMap GetProtocolHandlers(); | 121 virtual ProtocolHandlerMap GetProtocolHandlers(); |
122 | 122 |
123 // Whether or not we should request a TabSocket when creating |web_contents_|. | 123 // The TabSocket type to request when creating |web_contents_|. |
124 virtual bool GetCreateTabSocket(); | 124 virtual HeadlessWebContents::Builder::TabSocketType GetTabSocketType(); |
| 125 |
| 126 // Selects between creating the TabSocket only in an isolated world or the |
| 127 // main world. |
| 128 virtual bool GetCreateTabSocketOnlyForIsolatedWorld(); |
125 | 129 |
126 protected: | 130 protected: |
127 void RunTest(); | 131 void RunTest(); |
128 | 132 |
129 HeadlessBrowserContext* browser_context_; // Not owned. | 133 HeadlessBrowserContext* browser_context_; // Not owned. |
130 HeadlessWebContents* web_contents_; | 134 HeadlessWebContents* web_contents_; |
131 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; | 135 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; |
132 bool render_process_exited_; | 136 bool render_process_exited_; |
133 }; | 137 }; |
134 | 138 |
135 } // namespace headless | 139 } // namespace headless |
136 | 140 |
137 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ | 141 #endif // HEADLESS_TEST_HEADLESS_BROWSER_TEST_H_ |
OLD | NEW |