Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| 11 #include "chrome/browser/chromeos/login/users/user.h" | 11 #include "chrome/browser/chromeos/login/users/user.h" |
| 12 #include "chrome/browser/chromeos/login/users/user_manager.h" | 12 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
|
Nikita (slow)
2014/05/19 14:27:15
nit: not used
| |
| 14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
| 15 #include "chromeos/chromeos_switches.h" | 15 #include "chromeos/chromeos_switches.h" |
| 16 #include "chromeos/dbus/cryptohome_client.h" | 16 #include "chromeos/dbus/cryptohome_client.h" |
| 17 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 17 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
| 18 #include "chromeos/dbus/fake_session_manager_client.h" | 18 #include "chromeos/dbus/fake_session_manager_client.h" |
| 19 #include "chromeos/dbus/session_manager_client.h" | 19 #include "chromeos/dbus/session_manager_client.h" |
| 20 #include "content/public/test/test_utils.h" | 20 #include "content/public/test/test_utils.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "third_party/cros_system_api/dbus/service_constants.h" | 22 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const char kUserId1[] = "user1@example.com"; | 28 const char kUserId1[] = "user1@example.com"; |
| 29 const char kUserId2[] = "user2@example.com"; | 29 const char kUserId2[] = "user2@example.com"; |
| 30 const char kUserId3[] = "user3@example.com"; | 30 const char kUserId3[] = "user3@example.com"; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 class CrashRestoreSimpleTest : public InProcessBrowserTest { | 34 class CrashRestoreSimpleTest : public InProcessBrowserTest { |
| 35 protected: | 35 protected: |
| 36 CrashRestoreSimpleTest() {} | 36 CrashRestoreSimpleTest() {} |
| 37 | 37 |
| 38 virtual ~CrashRestoreSimpleTest() {} | 38 virtual ~CrashRestoreSimpleTest() {} |
| 39 | 39 |
| 40 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 40 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 41 command_line->AppendSwitch(::switches::kMultiProfiles); | |
| 42 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1); | 41 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1); |
| 43 command_line->AppendSwitchASCII( | 42 command_line->AppendSwitchASCII( |
| 44 switches::kLoginProfile, | 43 switches::kLoginProfile, |
| 45 CryptohomeClient::GetStubSanitizedUsername(kUserId1)); | 44 CryptohomeClient::GetStubSanitizedUsername(kUserId1)); |
| 46 } | 45 } |
| 47 | 46 |
| 48 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 47 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 49 // Redirect session_manager DBus calls to FakeSessionManagerClient. | 48 // Redirect session_manager DBus calls to FakeSessionManagerClient. |
| 50 FakeDBusThreadManager* dbus_thread_manager = new FakeDBusThreadManager; | 49 FakeDBusThreadManager* dbus_thread_manager = new FakeDBusThreadManager; |
| 51 dbus_thread_manager->SetFakeClients(); | 50 dbus_thread_manager->SetFakeClients(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 users[0]->username_hash()); | 147 users[0]->username_hash()); |
| 149 EXPECT_EQ(kUserId2, users[1]->email()); | 148 EXPECT_EQ(kUserId2, users[1]->email()); |
| 150 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2), | 149 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2), |
| 151 users[1]->username_hash()); | 150 users[1]->username_hash()); |
| 152 EXPECT_EQ(kUserId1, users[2]->email()); | 151 EXPECT_EQ(kUserId1, users[2]->email()); |
| 153 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1), | 152 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1), |
| 154 users[2]->username_hash()); | 153 users[2]->username_hash()); |
| 155 } | 154 } |
| 156 | 155 |
| 157 } // namespace chromeos | 156 } // namespace chromeos |
| OLD | NEW |