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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 virtual ~Waiter() { | 54 virtual ~Waiter() { |
55 } | 55 } |
56 | 56 |
57 virtual void Observe(int type, | 57 virtual void Observe(int type, |
58 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
59 const content::NotificationDetails& details) OVERRIDE { | 59 const content::NotificationDetails& details) OVERRIDE { |
60 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED || | 60 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED || |
61 type == chrome::NOTIFICATION_FULLSCREEN_CHANGED); | 61 type == chrome::NOTIFICATION_FULLSCREEN_CHANGED); |
62 if (running_) | 62 if (running_) |
63 MessageLoop::current()->Quit(); | 63 base::MessageLoop::current()->Quit(); |
64 } | 64 } |
65 | 65 |
66 // Wait until the two conditions are met. | 66 // Wait until the two conditions are met. |
67 void Wait(bool locker_state, bool fullscreen) { | 67 void Wait(bool locker_state, bool fullscreen) { |
68 running_ = true; | 68 running_ = true; |
69 scoped_ptr<chromeos::test::ScreenLockerTester> | 69 scoped_ptr<chromeos::test::ScreenLockerTester> |
70 tester(chromeos::ScreenLocker::GetTester()); | 70 tester(chromeos::ScreenLocker::GetTester()); |
71 while (tester->IsLocked() != locker_state || | 71 while (tester->IsLocked() != locker_state || |
72 browser_->window()->IsFullscreen() != fullscreen) { | 72 browser_->window()->IsFullscreen() != fullscreen) { |
73 content::RunMessageLoop(); | 73 content::RunMessageLoop(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 content::RunAllPendingInMessageLoop(); | 265 content::RunAllPendingInMessageLoop(); |
266 EXPECT_EQ("", tester->GetPassword()); | 266 EXPECT_EQ("", tester->GetPassword()); |
267 | 267 |
268 // Close the locker to match expectations. | 268 // Close the locker to match expectations. |
269 ScreenLocker::Hide(); | 269 ScreenLocker::Hide(); |
270 content::RunAllPendingInMessageLoop(); | 270 content::RunAllPendingInMessageLoop(); |
271 EXPECT_FALSE(tester->IsLocked()); | 271 EXPECT_FALSE(tester->IsLocked()); |
272 } | 272 } |
273 | 273 |
274 } // namespace chromeos | 274 } // namespace chromeos |
OLD | NEW |