| 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 #include "content/public/test/test_utils.h" | 5 #include "content/public/test/test_utils.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 loop->Run(); | 186 loop->Run(); |
| 187 return observer.result().Pass(); | 187 return observer.result().Pass(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool AreAllSitesIsolatedForTesting() { | 190 bool AreAllSitesIsolatedForTesting() { |
| 191 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 191 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 192 switches::kSitePerProcess); | 192 switches::kSitePerProcess); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void IsolateAllSitesForTesting(base::CommandLine* command_line) { | 195 void IsolateAllSitesForTesting(base::CommandLine* command_line) { |
| 196 EXPECT_TRUE(SiteIsolationPolicy::IsolateAllSitesForTesting()) | 196 command_line->AppendSwitch(switches::kSitePerProcess); |
| 197 << "IsolateAllSitesForTesting() called after " | |
| 198 << "SiteIsolationPolicy was already used"; | |
| 199 } | 197 } |
| 200 | 198 |
| 201 MessageLoopRunner::MessageLoopRunner() | 199 MessageLoopRunner::MessageLoopRunner() |
| 202 : loop_running_(false), | 200 : loop_running_(false), |
| 203 quit_closure_called_(false) { | 201 quit_closure_called_(false) { |
| 204 } | 202 } |
| 205 | 203 |
| 206 MessageLoopRunner::~MessageLoopRunner() { | 204 MessageLoopRunner::~MessageLoopRunner() { |
| 207 } | 205 } |
| 208 | 206 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 367 |
| 370 void WebContentsDestroyedWatcher::Wait() { | 368 void WebContentsDestroyedWatcher::Wait() { |
| 371 message_loop_runner_->Run(); | 369 message_loop_runner_->Run(); |
| 372 } | 370 } |
| 373 | 371 |
| 374 void WebContentsDestroyedWatcher::WebContentsDestroyed() { | 372 void WebContentsDestroyedWatcher::WebContentsDestroyed() { |
| 375 message_loop_runner_->Quit(); | 373 message_loop_runner_->Quit(); |
| 376 } | 374 } |
| 377 | 375 |
| 378 } // namespace content | 376 } // namespace content |
| OLD | NEW |