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

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

Issue 9181005: Allow resizing a panel using chrome.windows.update() extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add forgotten test file. Created 8 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/incognito_mode_prefs.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.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/pref_names.h" 12 #include "chrome/common/pref_names.h"
13 #include "net/base/mock_host_resolver.h" 13 #include "net/base/mock_host_resolver.h"
14 14
15 // Possible race in ChromeURLDataManager. http://crbug.com/59198 15 // Possible race in ChromeURLDataManager. http://crbug.com/59198
16 #if defined(OS_MACOSX) || defined(OS_LINUX) 16 #if defined(OS_MACOSX) || defined(OS_LINUX)
17 #define MAYBE_TabOnRemoved DISABLED_TabOnRemoved 17 #define MAYBE_TabOnRemoved DISABLED_TabOnRemoved
18 #else 18 #else
19 #define MAYBE_TabOnRemoved TabOnRemoved 19 #define MAYBE_TabOnRemoved TabOnRemoved
20 #endif 20 #endif
21 21
22 // Window resizes are not completed by the time the callback happens, 22 // Window resizes are not completed by the time the callback happens,
23 // so these tests fail on linux. http://crbug.com/72369 23 // so these tests fail on linux. http://crbug.com/72369
24 #if defined(OS_LINUX) 24 #if defined(OS_LINUX)
25 #define MAYBE_FocusWindowDoesNotExitFullscreen \ 25 #define MAYBE_FocusWindowDoesNotExitFullscreen \
26 DISABLED_FocusWindowDoesNotExitFullscreen 26 DISABLED_FocusWindowDoesNotExitFullscreen
27 #define MAYBE_UpdateWindowSizeExitsFullscreen \ 27 #define MAYBE_UpdateWindowSizeExitsFullscreen \
28 DISABLED_UpdateWindowSizeExitsFullscreen 28 DISABLED_UpdateWindowSizeExitsFullscreen
29 #define MAYBE_UpdateWindowShowState \ 29 #define MAYBE_UpdateWindowResize DISABLED_UpdateWindowResize
30 DISABLED_UpdateWindowShowState 30 #define MAYBE_UpdateWindowShowState DISABLED_UpdateWindowShowState
31 #else 31 #else
32 #define MAYBE_FocusWindowDoesNotExitFullscreen FocusWindowDoesNotExitFullscreen 32 #define MAYBE_FocusWindowDoesNotExitFullscreen FocusWindowDoesNotExitFullscreen
33 #define MAYBE_UpdateWindowSizeExitsFullscreen UpdateWindowSizeExitsFullscreen 33 #define MAYBE_UpdateWindowSizeExitsFullscreen UpdateWindowSizeExitsFullscreen
34 #define MAYBE_UpdateWindowResize UpdateWindowResize
34 #define MAYBE_UpdateWindowShowState UpdateWindowShowState 35 #define MAYBE_UpdateWindowShowState UpdateWindowShowState
35 #endif 36 #endif
36 37
37 // See crbug.com/108492. 38 // See crbug.com/108492.
38 #if defined(USE_AURA) && defined(OS_CHROMEOS) 39 #if defined(USE_AURA) && defined(OS_CHROMEOS)
39 #define MAYBE_Tabs DISABLED_Tabs 40 #define MAYBE_Tabs DISABLED_Tabs
40 #else 41 #else
41 #define MAYBE_Tabs Tabs 42 #define MAYBE_Tabs Tabs
42 #endif 43 #endif
43 44
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 172 }
172 173
173 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, 174 IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
174 MAYBE_UpdateWindowSizeExitsFullscreen) { 175 MAYBE_UpdateWindowSizeExitsFullscreen) {
175 browser()->window()->EnterFullscreen( 176 browser()->window()->EnterFullscreen(
176 GURL(), FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION); 177 GURL(), FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION);
177 ASSERT_TRUE(RunExtensionTest("window_update/sizing")) << message_; 178 ASSERT_TRUE(RunExtensionTest("window_update/sizing")) << message_;
178 ASSERT_FALSE(browser()->window()->IsFullscreen()); 179 ASSERT_FALSE(browser()->window()->IsFullscreen());
179 } 180 }
180 181
182 IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
183 MAYBE_UpdateWindowResize) {
184 ASSERT_TRUE(RunExtensionTest("window_update/resize")) << message_;
185 }
186
181 #if defined(OS_WIN) && !defined(USE_AURA) 187 #if defined(OS_WIN) && !defined(USE_AURA)
182 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FocusWindowDoesNotUnmaximize) { 188 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FocusWindowDoesNotUnmaximize) {
183 gfx::NativeWindow window = browser()->window()->GetNativeHandle(); 189 gfx::NativeWindow window = browser()->window()->GetNativeHandle();
184 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0); 190 ::SendMessage(window, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
185 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; 191 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_;
186 ASSERT_TRUE(::IsZoomed(window)); 192 ASSERT_TRUE(::IsZoomed(window));
187 } 193 }
188 #endif // OS_WIN 194 #endif // OS_WIN
189 195
190 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_UpdateWindowShowState) { 196 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_UpdateWindowShowState) {
(...skipping 15 matching lines...) Expand all
206 } 212 }
207 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, GetViewsOfCreatedWindow) { 213 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, GetViewsOfCreatedWindow) {
208 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) 214 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html"))
209 << message_; 215 << message_;
210 } 216 }
211 217
212 // Adding a new test? Awesome. But API tests are the old hotness. The 218 // Adding a new test? Awesome. But API tests are the old hotness. The
213 // new hotness is extension_test_utils. See extension_tabs_test.cc for 219 // new hotness is extension_test_utils. See extension_tabs_test.cc for
214 // an example. We are trying to phase out many uses of API tests as 220 // an example. We are trying to phase out many uses of API tests as
215 // they tend to be flaky. 221 // they tend to be flaky.
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698