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

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

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698