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

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

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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 "chrome/browser/chromeos/login/screen_locker.h" 5 #include "chrome/browser/chromeos/login/screen_locker.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 // Verifies if LockScreenDismissed() was called once. 111 // Verifies if LockScreenDismissed() was called once.
112 bool VerifyLockScreenDismissed() { 112 bool VerifyLockScreenDismissed() {
113 return 1 == fake_session_manager_client_-> 113 return 1 == fake_session_manager_client_->
114 notify_lock_screen_dismissed_call_count(); 114 notify_lock_screen_dismissed_call_count();
115 } 115 }
116 116
117 private: 117 private:
118 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 118 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
119 FakeDBusThreadManager* fake_dbus_thread_manager = 119 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager;
120 new FakeDBusThreadManager; 120 fake_dbus_thread_manager->SetFakeClients();
121 fake_session_manager_client_ = new FakeSessionManagerClient;
122 fake_dbus_thread_manager->SetSessionManagerClient(
123 scoped_ptr<SessionManagerClient>(fake_session_manager_client_));
121 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); 124 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
125
122 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); 126 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
123 fake_session_manager_client_ =
124 fake_dbus_thread_manager->fake_session_manager_client();
125 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( 127 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode(
126 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); 128 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
127 } 129 }
128 130
129 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 131 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
130 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 132 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
131 } 133 }
132 134
133 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; 135 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
134 136
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 EXPECT_EQ("", tester->GetPassword()); 251 EXPECT_EQ("", tester->GetPassword());
250 252
251 // Close the locker to match expectations. 253 // Close the locker to match expectations.
252 ScreenLocker::Hide(); 254 ScreenLocker::Hide();
253 content::RunAllPendingInMessageLoop(); 255 content::RunAllPendingInMessageLoop();
254 EXPECT_FALSE(tester->IsLocked()); 256 EXPECT_FALSE(tester->IsLocked());
255 EXPECT_TRUE(VerifyLockScreenDismissed()); 257 EXPECT_TRUE(VerifyLockScreenDismissed());
256 } 258 }
257 259
258 } // namespace chromeos 260 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698