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/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 Loading... |
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 } |
OLD | NEW |