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

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: 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_session_manager_client_ = new FakeSessionManagerClient;
121 fake_dbus_thread_manager->SetSessionManagerClient(
122 scoped_ptr<SessionManagerClient>(fake_session_manager_client_));
121 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); 123 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
124
122 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); 125 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
123 fake_session_manager_client_ =
124 fake_dbus_thread_manager->fake_session_manager_client();
125 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( 126 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode(
126 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); 127 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
127 } 128 }
128 129
129 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 130 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
130 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 131 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
131 } 132 }
132 133
133 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; 134 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
134 135
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 EXPECT_EQ("", tester->GetPassword()); 250 EXPECT_EQ("", tester->GetPassword());
250 251
251 // Close the locker to match expectations. 252 // Close the locker to match expectations.
252 ScreenLocker::Hide(); 253 ScreenLocker::Hide();
253 content::RunAllPendingInMessageLoop(); 254 content::RunAllPendingInMessageLoop();
254 EXPECT_FALSE(tester->IsLocked()); 255 EXPECT_FALSE(tester->IsLocked());
255 EXPECT_TRUE(VerifyLockScreenDismissed()); 256 EXPECT_TRUE(VerifyLockScreenDismissed());
256 } 257 }
257 258
258 } // namespace chromeos 259 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698