| OLD | NEW |
| 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/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 8 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "net/dns/mock_host_resolver.h" | 15 #include "net/dns/mock_host_resolver.h" |
| 16 | 16 |
| 17 #if defined(OS_WIN) |
| 18 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/window.h" |
| 20 #endif |
| 17 | 21 |
| 18 // Window resizes are not completed by the time the callback happens, | 22 // Window resizes are not completed by the time the callback happens, |
| 19 // so these tests fail on linux/gtk. http://crbug.com/72369 | 23 // so these tests fail on linux/gtk. http://crbug.com/72369 |
| 20 #if defined(OS_LINUX) && !defined(USE_AURA) | 24 #if defined(OS_LINUX) && !defined(USE_AURA) |
| 21 #define MAYBE_UpdateWindowResize DISABLED_UpdateWindowResize | 25 #define MAYBE_UpdateWindowResize DISABLED_UpdateWindowResize |
| 22 #define MAYBE_UpdateWindowShowState DISABLED_UpdateWindowShowState | 26 #define MAYBE_UpdateWindowShowState DISABLED_UpdateWindowShowState |
| 23 #else | 27 #else |
| 24 | 28 |
| 25 #if defined(USE_AURA) || defined(OS_MACOSX) | 29 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 26 // Maximizing/fullscreen popup window doesn't work on aura's managed mode. | 30 // Maximizing/fullscreen popup window doesn't work on aura's managed mode. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 224 |
| 221 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsNoPermissions) { | 225 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsNoPermissions) { |
| 222 ASSERT_TRUE(RunExtensionTest("tabs/no_permissions")) << message_; | 226 ASSERT_TRUE(RunExtensionTest("tabs/no_permissions")) << message_; |
| 223 } | 227 } |
| 224 | 228 |
| 225 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, | 229 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
| 226 MAYBE_UpdateWindowResize) { | 230 MAYBE_UpdateWindowResize) { |
| 227 ASSERT_TRUE(RunExtensionTest("window_update/resize")) << message_; | 231 ASSERT_TRUE(RunExtensionTest("window_update/resize")) << message_; |
| 228 } | 232 } |
| 229 | 233 |
| 230 #if defined(OS_WIN) && !defined(USE_AURA) | 234 #if defined(OS_WIN) |
| 231 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FocusWindowDoesNotUnmaximize) { | 235 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FocusWindowDoesNotUnmaximize) { |
| 232 gfx::NativeWindow window = browser()->window()->GetNativeWindow(); | 236 HWND window = browser()->window()->GetNativeWindow()-> |
| 237 GetDispatcher()->host()->GetAcceleratedWidget(); |
| 233 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0); | 238 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0); |
| 234 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; | 239 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; |
| 235 ASSERT_TRUE(::IsZoomed(window)); | 240 ASSERT_TRUE(::IsZoomed(window)); |
| 236 } | 241 } |
| 237 #endif // OS_WIN | 242 #endif // OS_WIN |
| 238 | 243 |
| 239 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_UpdateWindowShowState) { | 244 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_UpdateWindowShowState) { |
| 240 ASSERT_TRUE(RunExtensionTest("window_update/show_state")) << message_; | 245 ASSERT_TRUE(RunExtensionTest("window_update/show_state")) << message_; |
| 241 } | 246 } |
| 242 | 247 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 254 << message_; | 259 << message_; |
| 255 } | 260 } |
| 256 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { | 261 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { |
| 257 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) | 262 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) |
| 258 << message_; | 263 << message_; |
| 259 } | 264 } |
| 260 | 265 |
| 261 // Adding a new test? Awesome. But API tests are the old hotness. The | 266 // Adding a new test? Awesome. But API tests are the old hotness. The |
| 262 // new hotness is extension_test_utils. See tabs_test.cc for an example. | 267 // new hotness is extension_test_utils. See tabs_test.cc for an example. |
| 263 // We are trying to phase out many uses of API tests as they tend to be flaky. | 268 // We are trying to phase out many uses of API tests as they tend to be flaky. |
| OLD | NEW |