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 // Create a service process that uses a Mock to respond to the browser in order | 5 // Create a service process that uses a Mock to respond to the browser in order |
6 // to test launching the browser using the cloud print policy check command | 6 // to test launching the browser using the cloud print policy check command |
7 // line switch. | 7 // line switch. |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 class WindowedChannelConnectionObserver { | 329 class WindowedChannelConnectionObserver { |
330 public: | 330 public: |
331 WindowedChannelConnectionObserver() | 331 WindowedChannelConnectionObserver() |
332 : seen_(false), | 332 : seen_(false), |
333 running_(false) { } | 333 running_(false) { } |
334 | 334 |
335 void Wait() { | 335 void Wait() { |
336 if (seen_) | 336 if (seen_) |
337 return; | 337 return; |
338 running_ = true; | 338 running_ = true; |
339 ui_test_utils::RunMessageLoop(); | 339 content::RunMessageLoop(); |
340 } | 340 } |
341 | 341 |
342 void Notify() { | 342 void Notify() { |
343 seen_ = true; | 343 seen_ = true; |
344 if (running_) | 344 if (running_) |
345 MessageLoopForUI::current()->Quit(); | 345 MessageLoopForUI::current()->Quit(); |
346 } | 346 } |
347 | 347 |
348 private: | 348 private: |
349 bool seen_; | 349 bool seen_; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // No expectations on run_loop being true here; that would be a race | 533 // No expectations on run_loop being true here; that would be a race |
534 // condition. | 534 // condition. |
535 if (run_loop) | 535 if (run_loop) |
536 MessageLoop::current()->Run(); | 536 MessageLoop::current()->Run(); |
537 | 537 |
538 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); | 538 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); |
539 | 539 |
540 ShutdownAndWaitForExitWithTimeout(handle); | 540 ShutdownAndWaitForExitWithTimeout(handle); |
541 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); | 541 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); |
542 } | 542 } |
OLD | NEW |