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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_navigator_browsertest_chromeos.cc
diff --git a/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc b/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ffc8a8d87891b34c721faa56b26639fa473a096f
--- /dev/null
+++ b/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc
@@ -0,0 +1,58 @@
+// 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.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
Evan Stade 2011/02/07 19:02:30 extra line
altimofeev 2011/02/08 14:21:00 Done.
+
+#include "chrome/browser/ui/browser_navigator_browsertest.h"
+
+#include "base/command_line.h"
+#include "chrome/browser/chromeos/login/login_utils.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_navigator.h"
+
+namespace {
+
+#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.
+
+// Subclass that tests navigation while in the Guest session.
+class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) {
+ CommandLine command_line_copy = *command_line;
+ chromeos::LoginUtils::Get()->GetOffTheRecordCommandLine(GetGoogleURL(),
+ command_line_copy,
+ command_line);
+ }
+};
+
+// This test verifies that the settings page is opened in the incognito window
+// in Guest Session (as well as all other windows in Guest session).
+IN_PROC_BROWSER_TEST_F(BrowserGuestSessionNavigatorTest,
+ Disposition_Settings_UseIncognitoWindow) {
+ Browser* incognito_browser = CreateIncognitoBrowser();
+
+ EXPECT_EQ(2u, BrowserList::size());
+ EXPECT_EQ(1, browser()->tab_count());
+ EXPECT_EQ(1, incognito_browser->tab_count());
+
+ // Navigate to the settings page.
+ browser::NavigateParams p(MakeNavigateParams(incognito_browser));
+ p.disposition = SINGLETON_TAB;
+ p.url = GURL("chrome://settings");
+ p.show_window = true;
+ p.ignore_path = true;
+ browser::Navigate(&p);
+
+ // Settings page should be opened in incognito window.
+ EXPECT_NE(browser(), p.browser);
+ EXPECT_EQ(incognito_browser, p.browser);
+ EXPECT_EQ(2, incognito_browser->tab_count());
+ EXPECT_EQ(GURL("chrome://settings"),
+ incognito_browser->GetSelectedTabContents()->GetURL());
+}
+
+#endif
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698