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

Side by Side Diff: chrome/browser/chromeos/login/crash_restore_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 29 matching lines...) Expand all
40 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 40 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
41 command_line->AppendSwitch(::switches::kMultiProfiles); 41 command_line->AppendSwitch(::switches::kMultiProfiles);
42 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1); 42 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1);
43 command_line->AppendSwitchASCII( 43 command_line->AppendSwitchASCII(
44 switches::kLoginProfile, 44 switches::kLoginProfile,
45 CryptohomeClient::GetStubSanitizedUsername(kUserId1)); 45 CryptohomeClient::GetStubSanitizedUsername(kUserId1));
46 } 46 }
47 47
48 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 48 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
49 // Redirect session_manager DBus calls to FakeSessionManagerClient. 49 // Redirect session_manager DBus calls to FakeSessionManagerClient.
50 FakeDBusThreadManager* dbus_thread_manager = 50 FakeDBusThreadManager* dbus_thread_manager = new FakeDBusThreadManager;
51 new FakeDBusThreadManager(); 51 dbus_thread_manager->SetFakeClients();
52 session_manager_client_ = 52 session_manager_client_ = new FakeSessionManagerClient;
53 dbus_thread_manager->fake_session_manager_client(); 53 dbus_thread_manager->SetSessionManagerClient(
54 scoped_ptr<SessionManagerClient>(session_manager_client_));
54 DBusThreadManager::InitializeForTesting(dbus_thread_manager); 55 DBusThreadManager::InitializeForTesting(dbus_thread_manager);
55 session_manager_client_->StartSession(kUserId1); 56 session_manager_client_->StartSession(kUserId1);
56 } 57 }
57 58
58 FakeSessionManagerClient* session_manager_client_; 59 FakeSessionManagerClient* session_manager_client_;
59 }; 60 };
60 61
61 IN_PROC_BROWSER_TEST_F(CrashRestoreSimpleTest, RestoreSessionForOneUser) { 62 IN_PROC_BROWSER_TEST_F(CrashRestoreSimpleTest, RestoreSessionForOneUser) {
62 UserManager* user_manager = UserManager::Get(); 63 UserManager* user_manager = UserManager::Get();
63 User* user = user_manager->GetActiveUser(); 64 User* user = user_manager->GetActiveUser();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 users[0]->username_hash()); 148 users[0]->username_hash());
148 EXPECT_EQ(kUserId2, users[1]->email()); 149 EXPECT_EQ(kUserId2, users[1]->email());
149 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2), 150 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2),
150 users[1]->username_hash()); 151 users[1]->username_hash());
151 EXPECT_EQ(kUserId1, users[2]->email()); 152 EXPECT_EQ(kUserId1, users[2]->email());
152 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1), 153 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1),
153 users[2]->username_hash()); 154 users[2]->username_hash());
154 } 155 }
155 156
156 } // namespace chromeos 157 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698