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

Side by Side Diff: chrome/browser/ui/browser_navigator_browsertest_chromeos.cc

Issue 13671005: Re-apply 192420: Move login switches to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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/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/browser/chromeos/login/chrome_restart_request.h" 8 #include "chrome/browser/chromeos/login/chrome_restart_request.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
11 #include "chrome/browser/ui/browser_navigator.h" 11 #include "chrome/browser/ui/browser_navigator.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
15 #include "chromeos/chromeos_switches.h"
15 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
16 17
17 namespace { 18 namespace {
18 19
19 GURL GetGoogleURL() { 20 GURL GetGoogleURL() {
20 return GURL("http://www.google.com/"); 21 return GURL("http://www.google.com/");
21 } 22 }
22 23
23 // Subclass that tests navigation while in the Guest session. 24 // Subclass that tests navigation while in the Guest session.
24 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { 25 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest {
25 protected: 26 protected:
26 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 27 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
27 CommandLine command_line_copy = *command_line; 28 CommandLine command_line_copy = *command_line;
28 command_line_copy.AppendSwitchASCII(switches::kLoginProfile, "user"); 29 command_line_copy.AppendSwitchASCII(
30 chromeos::switches::kLoginProfile, "user");
29 chromeos::GetOffTheRecordCommandLine(GetGoogleURL(), 31 chromeos::GetOffTheRecordCommandLine(GetGoogleURL(),
30 command_line_copy, 32 command_line_copy,
31 command_line); 33 command_line);
32 } 34 }
33 }; 35 };
34 36
35 // This test verifies that the settings page is opened in the incognito window 37 // This test verifies that the settings page is opened in the incognito window
36 // in Guest Session (as well as all other windows in Guest session). 38 // in Guest Session (as well as all other windows in Guest session).
37 IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest, 39 IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest,
38 Disposition_Settings_UseIncognitoWindow) { 40 Disposition_Settings_UseIncognitoWindow) {
(...skipping 14 matching lines...) Expand all
53 // Settings page should be opened in incognito window. 55 // Settings page should be opened in incognito window.
54 EXPECT_NE(browser(), p.browser); 56 EXPECT_NE(browser(), p.browser);
55 EXPECT_EQ(incognito_browser, p.browser); 57 EXPECT_EQ(incognito_browser, p.browser);
56 EXPECT_EQ(2, incognito_browser->tab_strip_model()->count()); 58 EXPECT_EQ(2, incognito_browser->tab_strip_model()->count());
57 EXPECT_EQ(GURL("chrome://chrome/settings"), 59 EXPECT_EQ(GURL("chrome://chrome/settings"),
58 incognito_browser->tab_strip_model()->GetActiveWebContents()-> 60 incognito_browser->tab_strip_model()->GetActiveWebContents()->
59 GetURL()); 61 GetURL());
60 } 62 }
61 63
62 } // namespace 64 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698