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

Side by Side Diff: chrome/browser/chromeos/login/screen_locker_browsertest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | Annotate | Revision Log
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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
9 #include "chrome/browser/chromeos/cros/mock_network_library.h" 9 #include "chrome/browser/chromeos/cros/mock_network_library.h"
10 #include "chrome/browser/chromeos/login/mock_authenticator.h" 10 #include "chrome/browser/chromeos/login/mock_authenticator.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 virtual ~Waiter() { 52 virtual ~Waiter() {
53 } 53 }
54 54
55 virtual void Observe(int type, 55 virtual void Observe(int type,
56 const content::NotificationSource& source, 56 const content::NotificationSource& source,
57 const content::NotificationDetails& details) OVERRIDE { 57 const content::NotificationDetails& details) OVERRIDE {
58 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED || 58 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED ||
59 type == chrome::NOTIFICATION_FULLSCREEN_CHANGED); 59 type == chrome::NOTIFICATION_FULLSCREEN_CHANGED);
60 if (running_) 60 if (running_)
61 MessageLoop::current()->Quit(); 61 base::MessageLoop::current()->Quit();
62 } 62 }
63 63
64 // Wait until the two conditions are met. 64 // Wait until the two conditions are met.
65 void Wait(bool locker_state, bool fullscreen) { 65 void Wait(bool locker_state, bool fullscreen) {
66 running_ = true; 66 running_ = true;
67 scoped_ptr<chromeos::test::ScreenLockerTester> 67 scoped_ptr<chromeos::test::ScreenLockerTester>
68 tester(chromeos::ScreenLocker::GetTester()); 68 tester(chromeos::ScreenLocker::GetTester());
69 while (tester->IsLocked() != locker_state || 69 while (tester->IsLocked() != locker_state ||
70 browser_->window()->IsFullscreen() != fullscreen) { 70 browser_->window()->IsFullscreen() != fullscreen) {
71 content::RunMessageLoop(); 71 content::RunMessageLoop();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 EXPECT_EQ("", tester->GetPassword()); 264 EXPECT_EQ("", tester->GetPassword());
265 265
266 // Close the locker to match expectations. 266 // Close the locker to match expectations.
267 ScreenLocker::Hide(); 267 ScreenLocker::Hide();
268 content::RunAllPendingInMessageLoop(); 268 content::RunAllPendingInMessageLoop();
269 EXPECT_FALSE(tester->IsLocked()); 269 EXPECT_FALSE(tester->IsLocked());
270 EXPECT_TRUE(VerifyLockScreenDismissed()); 270 EXPECT_TRUE(VerifyLockScreenDismissed());
271 } 271 }
272 272
273 } // namespace chromeos 273 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | chrome/browser/chromeos/login/screen_locker_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698