| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser_navigator_browsertest.h" | 5 #include "chrome/browser/ui/browser_navigator_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/common/chrome_switches.h" |
| 8 #include "chrome/browser/chromeos/login/login_utils.h" | 9 #include "chrome/browser/chromeos/login/login_utils.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
| 12 #include "chrome/browser/ui/browser_navigator.h" | 13 #include "chrome/browser/ui/browser_navigator.h" |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 // Subclass that tests navigation while in the Guest session. | 17 // Subclass that tests navigation while in the Guest session. |
| 17 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { | 18 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { |
| 18 protected: | 19 protected: |
| 19 virtual void SetUpCommandLine(CommandLine* command_line) { | 20 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 20 CommandLine command_line_copy = *command_line; | 21 CommandLine command_line_copy = *command_line; |
| 22 command_line_copy.AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 21 chromeos::LoginUtils::Get()->GetOffTheRecordCommandLine(GetGoogleURL(), | 23 chromeos::LoginUtils::Get()->GetOffTheRecordCommandLine(GetGoogleURL(), |
| 22 command_line_copy, | 24 command_line_copy, |
| 23 command_line); | 25 command_line); |
| 24 } | 26 } |
| 25 }; | 27 }; |
| 26 | 28 |
| 27 // This test verifies that the settings page is opened in the incognito window | 29 // This test verifies that the settings page is opened in the incognito window |
| 28 // in Guest Session (as well as all other windows in Guest session). | 30 // in Guest Session (as well as all other windows in Guest session). |
| 29 IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest, | 31 IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest, |
| 30 Disposition_Settings_UseIncognitoWindow) { | 32 Disposition_Settings_UseIncognitoWindow) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 44 | 46 |
| 45 // Settings page should be opened in incognito window. | 47 // Settings page should be opened in incognito window. |
| 46 EXPECT_NE(browser(), p.browser); | 48 EXPECT_NE(browser(), p.browser); |
| 47 EXPECT_EQ(incognito_browser, p.browser); | 49 EXPECT_EQ(incognito_browser, p.browser); |
| 48 EXPECT_EQ(2, incognito_browser->tab_count()); | 50 EXPECT_EQ(2, incognito_browser->tab_count()); |
| 49 EXPECT_EQ(GURL("chrome://settings"), | 51 EXPECT_EQ(GURL("chrome://settings"), |
| 50 incognito_browser->GetSelectedTabContents()->GetURL()); | 52 incognito_browser->GetSelectedTabContents()->GetURL()); |
| 51 } | 53 } |
| 52 | 54 |
| 53 } // namespace | 55 } // namespace |
| OLD | NEW |