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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |