Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: content/public/test/browser_test_utils.h

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Attempt to fix compile. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/command_line.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "base/files/scoped_temp_dir.h" 15 #include "base/files/scoped_temp_dir.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/process/process.h" 17 #include "base/process/process.h"
17 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
18 #include "content/public/browser/browser_message_filter.h" 19 #include "content/public/browser/browser_message_filter.h"
19 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
20 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
21 #include "content/public/browser/render_process_host_observer.h" 22 #include "content/public/browser/render_process_host_observer.h"
22 #include "content/public/browser/web_contents_observer.h" 23 #include "content/public/browser/web_contents_observer.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // Waits for an interstitial page to detach from given web contents. 240 // Waits for an interstitial page to detach from given web contents.
240 void WaitForInterstitialDetach(content::WebContents* web_contents); 241 void WaitForInterstitialDetach(content::WebContents* web_contents);
241 242
242 // Runs task and waits for an interstitial page to detach from given web 243 // Runs task and waits for an interstitial page to detach from given web
243 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be 244 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be
244 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting 245 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting
245 // for an interstitial detach after closing a tab). 246 // for an interstitial detach after closing a tab).
246 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, 247 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents,
247 const base::Closure& task); 248 const base::Closure& task);
248 249
250 // Returns true if all sites are isolated. Typically used to bail from a test
251 // that is incompatible with --site-per-process.
252 bool AreAllSitesIsolatedForTesting();
253
254 // Appends --site-per-process to the command line, enabling tests to exercise
255 // site isolation and cross-process iframes.
256 //
257 // TODO(nick): In some places this method is called from the top of a test
258 // body. That's not strictly safe (it's setting a command line after it
259 // already may have been read). We should try make that pattern safer, as it
260 // makes browser tests easier to write.
261 void IsolateAllSitesForTesting(base::CommandLine* command_line);
262
249 // Waits until all resources have loaded in the given RenderFrameHost. 263 // Waits until all resources have loaded in the given RenderFrameHost.
250 // When the load completes, this function sends a "pageLoadComplete" message 264 // When the load completes, this function sends a "pageLoadComplete" message
251 // via domAutomationController. The caller should make sure this extra 265 // via domAutomationController. The caller should make sure this extra
252 // message is handled properly. 266 // message is handled properly.
253 bool WaitForRenderFrameReady(RenderFrameHost* rfh) WARN_UNUSED_RESULT; 267 bool WaitForRenderFrameReady(RenderFrameHost* rfh) WARN_UNUSED_RESULT;
254 268
255 // Watches title changes on a WebContents, blocking until an expected title is 269 // Watches title changes on a WebContents, blocking until an expected title is
256 // set. 270 // set.
257 class TitleWatcher : public WebContentsObserver { 271 class TitleWatcher : public WebContentsObserver {
258 public: 272 public:
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 int routing_id_; 464 int routing_id_;
451 bool deleted_; 465 bool deleted_;
452 scoped_ptr<base::RunLoop> runner_; 466 scoped_ptr<base::RunLoop> runner_;
453 467
454 DISALLOW_COPY_AND_ASSIGN(RenderFrameDeletedObserver); 468 DISALLOW_COPY_AND_ASSIGN(RenderFrameDeletedObserver);
455 }; 469 };
456 470
457 } // namespace content 471 } // namespace content
458 472
459 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 473 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/public/common/browser_plugin_guest_mode.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698