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

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

Issue 6272016: Prevent non-Incognito windows in the Guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser
Patch Set: merge Created 9 years, 10 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
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
Evan Stade 2011/02/07 19:02:30 year again (every file in this CL should be update
altimofeev 2011/02/08 14:21:00 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
Evan Stade 2011/02/07 19:02:30 extra line
altimofeev 2011/02/08 14:21:00 Done.
5
6 #include "chrome/browser/ui/browser_navigator_browsertest.h"
7
8 #include "base/command_line.h"
9 #include "chrome/browser/chromeos/login/login_utils.h"
10 #include "chrome/browser/tab_contents/tab_contents.h"
11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_list.h"
13 #include "chrome/browser/ui/browser_navigator.h"
14
15 namespace {
16
17 #if defined(OS_CHROMEOS)
Evan Stade 2011/02/07 19:02:30 not necessary. This file will only be compiled on
altimofeev 2011/02/08 14:21:00 Done.
18
19 // Subclass that tests navigation while in the Guest session.
20 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest {
21 protected:
22 virtual void SetUpCommandLine(CommandLine* command_line) {
23 CommandLine command_line_copy = *command_line;
24 chromeos::LoginUtils::Get()->GetOffTheRecordCommandLine(GetGoogleURL(),
25 command_line_copy,
26 command_line);
27 }
28 };
29
30 // This test verifies that the settings page is opened in the incognito window
31 // in Guest Session (as well as all other windows in Guest session).
32 IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest,
33 Disposition_Settings_UseIncognitoWindow) {
34 Browser* incognito_browser = CreateIncognitoBrowser();
35
36 EXPECT_EQ(2u, BrowserList::size());
37 EXPECT_EQ(1, browser()->tab_count());
38 EXPECT_EQ(1, incognito_browser->tab_count());
39
40 // Navigate to the settings page.
41 browser::NavigateParams p(MakeNavigateParams(incognito_browser));
42 p.disposition = SINGLETON_TAB;
43 p.url = GURL("chrome://settings");
44 p.show_window = true;
45 p.ignore_path = true;
46 browser::Navigate(&p);
47
48 // Settings page should be opened in incognito window.
49 EXPECT_NE(browser(), p.browser);
50 EXPECT_EQ(incognito_browser, p.browser);
51 EXPECT_EQ(2, incognito_browser->tab_count());
52 EXPECT_EQ(GURL("chrome://settings"),
53 incognito_browser->GetSelectedTabContents()->GetURL());
54 }
55
56 #endif
57
58 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698