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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 MessageLoop::current()->Quit(); | 54 MessageLoop::current()->Quit(); |
55 } | 55 } |
56 | 56 |
57 // Wait until the two conditions are met. | 57 // Wait until the two conditions are met. |
58 void Wait(bool locker_state, bool fullscreen) { | 58 void Wait(bool locker_state, bool fullscreen) { |
59 running_ = true; | 59 running_ = true; |
60 scoped_ptr<chromeos::test::ScreenLockerTester> | 60 scoped_ptr<chromeos::test::ScreenLockerTester> |
61 tester(chromeos::ScreenLocker::GetTester()); | 61 tester(chromeos::ScreenLocker::GetTester()); |
62 while (tester->IsLocked() != locker_state || | 62 while (tester->IsLocked() != locker_state || |
63 browser_->window()->IsFullscreen() != fullscreen) { | 63 browser_->window()->IsFullscreen() != fullscreen) { |
64 ui_test_utils::RunMessageLoop(); | 64 content::RunMessageLoop(); |
65 } | 65 } |
66 // Make sure all pending tasks are executed. | 66 // Make sure all pending tasks are executed. |
67 ui_test_utils::RunAllPendingInMessageLoop(); | 67 ui_test_utils::RunAllPendingInMessageLoop(); |
68 running_ = false; | 68 running_ = false; |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 Browser* browser_; | 72 Browser* browser_; |
73 content::NotificationRegistrar registrar_; | 73 content::NotificationRegistrar registrar_; |
74 | 74 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 ui_test_utils::RunAllPendingInMessageLoop(); | 245 ui_test_utils::RunAllPendingInMessageLoop(); |
246 EXPECT_EQ("", tester->GetPassword()); | 246 EXPECT_EQ("", tester->GetPassword()); |
247 | 247 |
248 // Close the locker to match expectations. | 248 // Close the locker to match expectations. |
249 ScreenLocker::Hide(); | 249 ScreenLocker::Hide(); |
250 ui_test_utils::RunAllPendingInMessageLoop(); | 250 ui_test_utils::RunAllPendingInMessageLoop(); |
251 EXPECT_FALSE(tester->IsLocked()); | 251 EXPECT_FALSE(tester->IsLocked()); |
252 } | 252 } |
253 | 253 |
254 } // namespace chromeos | 254 } // namespace chromeos |
OLD | NEW |