OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Returns true if all sites are isolated. Typically used to bail from a test | 75 // Returns true if all sites are isolated. Typically used to bail from a test |
76 // that is incompatible with --site-per-process. | 76 // that is incompatible with --site-per-process. |
77 bool AreAllSitesIsolatedForTesting(); | 77 bool AreAllSitesIsolatedForTesting(); |
78 | 78 |
79 // Appends --site-per-process to the command line, enabling tests to exercise | 79 // Appends --site-per-process to the command line, enabling tests to exercise |
80 // site isolation and cross-process iframes. This must be called early in | 80 // site isolation and cross-process iframes. This must be called early in |
81 // the test; the flag will be read on the first real navigation. | 81 // the test; the flag will be read on the first real navigation. |
82 void IsolateAllSitesForTesting(base::CommandLine* command_line); | 82 void IsolateAllSitesForTesting(base::CommandLine* command_line); |
83 | 83 |
| 84 // Resets the internal secure schemes/origins whitelist. |
| 85 void ResetSchemesAndOriginsWhitelist(); |
| 86 |
84 #if defined(OS_ANDROID) | 87 #if defined(OS_ANDROID) |
85 // Registers content/browser JNI bindings necessary for some types of tests. | 88 // Registers content/browser JNI bindings necessary for some types of tests. |
86 bool RegisterJniForTesting(JNIEnv* env); | 89 bool RegisterJniForTesting(JNIEnv* env); |
87 #endif | 90 #endif |
88 | 91 |
89 // Helper class to Run and Quit the message loop. Run and Quit can only happen | 92 // Helper class to Run and Quit the message loop. Run and Quit can only happen |
90 // once per instance. Make a new instance for each use. Calling Quit after Run | 93 // once per instance. Make a new instance for each use. Calling Quit after Run |
91 // has returned is safe and has no effect. | 94 // has returned is safe and has no effect. |
92 // Note that by default Quit does not quit immediately. If that is not what you | 95 // Note that by default Quit does not quit immediately. If that is not what you |
93 // really need, pass QuitMode::IMMEDIATE in the constructor. | 96 // really need, pass QuitMode::IMMEDIATE in the constructor. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 void WebContentsDestroyed() override; | 304 void WebContentsDestroyed() override; |
302 | 305 |
303 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 306 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
304 | 307 |
305 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); | 308 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); |
306 }; | 309 }; |
307 | 310 |
308 } // namespace content | 311 } // namespace content |
309 | 312 |
310 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 313 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
OLD | NEW |