Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/time.h" | 6 #include "base/time.h" |
| 7 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 7 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
| 8 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" | 8 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" |
| 9 #include "chrome/browser/chromeos/cros/mock_library_loader.h" | 9 #include "chrome/browser/chromeos/cros/mock_library_loader.h" |
| 10 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 10 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 LoginTestBase::SetUpInProcessBrowserTestFixture(); | 57 LoginTestBase::SetUpInProcessBrowserTestFixture(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual void SetUpCommandLine(CommandLine* command_line) { | 60 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 61 command_line->AppendSwitchASCII(switches::kLoginUser, "TestUser@gmail.com"); | 61 command_line->AppendSwitchASCII(switches::kLoginUser, "TestUser@gmail.com"); |
| 62 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 62 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 63 command_line->AppendSwitch(switches::kNoFirstRun); | 63 command_line->AppendSwitch(switches::kNoFirstRun); |
| 64 } | 64 } |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 class LoginProfileTest : public LoginUserTest { | 67 class LoginProfileTest : public LoginUserTest { |
|
Nikita (slow)
2012/06/20 13:28:32
nit: LoginGuestProfileTest ?
Ivan Korotkov
2012/06/21 12:25:12
Done.
| |
| 68 protected: | 68 protected: |
| 69 virtual void SetUpCommandLine(CommandLine* command_line) { | 69 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 70 command_line->AppendSwitch(switches::kGuestSession); | |
|
Nikita (slow)
2012/06/20 13:28:32
FYI, Guest session is initialized as
command_li
Ivan Korotkov
2012/06/21 12:25:12
Added --incognito, though it shouldn't have any ef
| |
| 70 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 71 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 71 command_line->AppendSwitch(switches::kNoFirstRun); | 72 command_line->AppendSwitch(switches::kNoFirstRun); |
| 72 } | 73 } |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 // After a chrome crash, the session manager will restart chrome with | 76 // After a chrome crash, the session manager will restart chrome with |
| 76 // the -login-user flag indicating that the user is already logged in. | 77 // the -login-user flag indicating that the user is already logged in. |
| 77 // This profile should NOT be an OTR profile. | 78 // This profile should NOT be an OTR profile. |
| 78 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { | 79 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { |
| 79 Profile* profile = browser()->profile(); | 80 Profile* profile = browser()->profile(); |
| 80 EXPECT_EQ("user", profile->GetPath().BaseName().value()); | 81 EXPECT_EQ("user", profile->GetPath().BaseName().value()); |
| 81 EXPECT_FALSE(profile->IsOffTheRecord()); | 82 EXPECT_FALSE(profile->IsOffTheRecord()); |
| 82 } | 83 } |
| 83 | 84 |
| 84 // On initial launch, we should get the OTR default profile. | 85 // On initial launch, we should get the OTR default profile. |
| 85 IN_PROC_BROWSER_TEST_F(LoginProfileTest, UserNotPassed) { | 86 IN_PROC_BROWSER_TEST_F(LoginProfileTest, UserNotPassed) { |
|
Nikita (slow)
2012/06/20 13:28:32
Please update test name + comment.
I guess it is t
Ivan Korotkov
2012/06/21 12:25:12
Done.
| |
| 86 Profile* profile = browser()->profile(); | 87 Profile* profile = browser()->profile(); |
| 87 EXPECT_EQ("Default", profile->GetPath().BaseName().value()); | 88 EXPECT_EQ("Default", profile->GetPath().BaseName().value()); |
| 88 EXPECT_TRUE(profile->IsOffTheRecord()); | 89 EXPECT_TRUE(profile->IsOffTheRecord()); |
| 89 // Ensure there's extension service for this profile. | 90 // Ensure there's extension service for this profile. |
| 90 EXPECT_TRUE(profile->GetExtensionService()); | 91 EXPECT_TRUE(profile->GetExtensionService()); |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace chromeos | 94 } // namespace chromeos |
| OLD | NEW |