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

Side by Side Diff: chrome/browser/extensions/extension_tabs_apitest.cc

Issue 7520023: Converted IncognitoForced boolean policy into IncognitoModeAvailability enum policy. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed unnecessary comment. Created 9 years, 4 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) 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/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 6
7 #include "chrome/browser/prefs/incognito_mode_prefs.h"
7 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
12 #include "net/base/mock_host_resolver.h" 13 #include "net/base/mock_host_resolver.h"
13 14
14 // Possible race in ChromeURLDataManager. http://crbug.com/59198 15 // Possible race in ChromeURLDataManager. http://crbug.com/59198
15 #if defined(OS_MACOSX) || defined(OS_LINUX) 16 #if defined(OS_MACOSX) || defined(OS_LINUX)
16 #define MAYBE_TabOnRemoved DISABLED_TabOnRemoved 17 #define MAYBE_TabOnRemoved DISABLED_TabOnRemoved
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 gfx::NativeWindow window = browser()->window()->GetNativeHandle(); 194 gfx::NativeWindow window = browser()->window()->GetNativeHandle();
194 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0); 195 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
195 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; 196 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_;
196 ASSERT_TRUE(::IsZoomed(window)); 197 ASSERT_TRUE(::IsZoomed(window));
197 } 198 }
198 #endif // OS_WIN 199 #endif // OS_WIN
199 200
200 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabledByPref) { 201 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabledByPref) {
201 ASSERT_TRUE(StartTestServer()); 202 ASSERT_TRUE(StartTestServer());
202 203
203 browser()->profile()->GetPrefs()->SetBoolean(prefs::kIncognitoEnabled, false); 204 IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(),
205 IncognitoModePrefs::DISABLED);
204 206
205 // This makes sure that creating an incognito window fails due to pref 207 // This makes sure that creating an incognito window fails due to pref
206 // (policy) being set. 208 // (policy) being set.
207 ASSERT_TRUE(RunExtensionTest("tabs/incognito_disabled")) << message_; 209 ASSERT_TRUE(RunExtensionTest("tabs/incognito_disabled")) << message_;
208 } 210 }
209 211
210 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetViewsOfCreatedPopup) { 212 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetViewsOfCreatedPopup) {
211 ASSERT_TRUE(StartTestServer()); 213 ASSERT_TRUE(StartTestServer());
212 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_popup.html")) 214 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_popup.html"))
213 << message_; 215 << message_;
214 } 216 }
215 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetViewsOfCreatedWindow) { 217 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetViewsOfCreatedWindow) {
216 ASSERT_TRUE(StartTestServer()); 218 ASSERT_TRUE(StartTestServer());
217 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) 219 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html"))
218 << message_; 220 << message_;
219 } 221 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_context_menu_controller.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698