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

Side by Side Diff: chrome/browser/ui/ash/accelerator_commands_browsertest.cc

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/accelerators/accelerator_commands.h" 5 #include "ash/accelerators/accelerator_commands.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 const extensions::Extension* extension = LoadAndLaunchPlatformApp("minimal", 273 const extensions::Extension* extension = LoadAndLaunchPlatformApp("minimal",
274 "Launched"); 274 "Launched");
275 275
276 { 276 {
277 // Test that ToggleFullscreen() toggles a platform's app's fullscreen 277 // Test that ToggleFullscreen() toggles a platform's app's fullscreen
278 // state and that it additionally puts the app into immersive fullscreen 278 // state and that it additionally puts the app into immersive fullscreen
279 // if put_all_windows_in_immersive() returns true. 279 // if put_all_windows_in_immersive() returns true.
280 extensions::AppWindow::CreateParams params; 280 extensions::AppWindow::CreateParams params;
281 params.frame = extensions::AppWindow::FRAME_CHROME; 281 params.frame = extensions::AppWindow::FRAME_CHROME;
282 extensions::AppWindow* app_window = 282 extensions::AppWindow* app_window =
283 CreateAppWindowFromParams(extension, params); 283 CreateAppWindowFromParams(browser()->profile(), extension, params);
284 extensions::NativeAppWindow* native_app_window = 284 extensions::NativeAppWindow* native_app_window =
285 app_window->GetBaseWindow(); 285 app_window->GetBaseWindow();
286 SetToInitialShowState(app_window); 286 SetToInitialShowState(app_window);
287 ASSERT_TRUE(app_window->GetBaseWindow()->IsActive()); 287 ASSERT_TRUE(app_window->GetBaseWindow()->IsActive());
288 EXPECT_TRUE(IsInitialShowState(app_window)); 288 EXPECT_TRUE(IsInitialShowState(app_window));
289 289
290 ash::accelerators::ToggleFullscreen(); 290 ash::accelerators::ToggleFullscreen();
291 EXPECT_TRUE(native_app_window->IsFullscreen()); 291 EXPECT_TRUE(native_app_window->IsFullscreen());
292 ash::wm::WindowState* window_state = 292 ash::wm::WindowState* window_state =
293 ash::wm::GetWindowState(native_app_window->GetNativeWindow()); 293 ash::wm::GetWindowState(native_app_window->GetNativeWindow());
294 EXPECT_TRUE(IsInImmersiveFullscreen(window_state)); 294 EXPECT_TRUE(IsInImmersiveFullscreen(window_state));
295 295
296 ash::accelerators::ToggleFullscreen(); 296 ash::accelerators::ToggleFullscreen();
297 EXPECT_TRUE(IsInitialShowState(app_window)); 297 EXPECT_TRUE(IsInitialShowState(app_window));
298 298
299 CloseAppWindow(app_window); 299 CloseAppWindow(app_window);
300 } 300 }
301 301
302 { 302 {
303 // Repeat the test, but make sure that frameless platform apps are never put 303 // Repeat the test, but make sure that frameless platform apps are never put
304 // into immersive fullscreen. 304 // into immersive fullscreen.
305 extensions::AppWindow::CreateParams params; 305 extensions::AppWindow::CreateParams params;
306 params.frame = extensions::AppWindow::FRAME_NONE; 306 params.frame = extensions::AppWindow::FRAME_NONE;
307 extensions::AppWindow* app_window = 307 extensions::AppWindow* app_window =
308 CreateAppWindowFromParams(extension, params); 308 CreateAppWindowFromParams(browser()->profile(), extension, params);
309 extensions::NativeAppWindow* native_app_window = 309 extensions::NativeAppWindow* native_app_window =
310 app_window->GetBaseWindow(); 310 app_window->GetBaseWindow();
311 ASSERT_TRUE(app_window->GetBaseWindow()->IsActive()); 311 ASSERT_TRUE(app_window->GetBaseWindow()->IsActive());
312 SetToInitialShowState(app_window); 312 SetToInitialShowState(app_window);
313 EXPECT_TRUE(IsInitialShowState(app_window)); 313 EXPECT_TRUE(IsInitialShowState(app_window));
314 314
315 ash::accelerators::ToggleFullscreen(); 315 ash::accelerators::ToggleFullscreen();
316 EXPECT_TRUE(native_app_window->IsFullscreen()); 316 EXPECT_TRUE(native_app_window->IsFullscreen());
317 ash::wm::WindowState* window_state = 317 ash::wm::WindowState* window_state =
318 ash::wm::GetWindowState(native_app_window->GetNativeWindow()); 318 ash::wm::GetWindowState(native_app_window->GetNativeWindow());
319 EXPECT_FALSE(IsInImmersiveFullscreen(window_state)); 319 EXPECT_FALSE(IsInImmersiveFullscreen(window_state));
320 320
321 ash::accelerators::ToggleFullscreen(); 321 ash::accelerators::ToggleFullscreen();
322 EXPECT_TRUE(IsInitialShowState(app_window)); 322 EXPECT_TRUE(IsInitialShowState(app_window));
323 323
324 CloseAppWindow(app_window); 324 CloseAppWindow(app_window);
325 } 325 }
326 } 326 }
327 327
328 INSTANTIATE_TEST_CASE_P(InitiallyRestored, 328 INSTANTIATE_TEST_CASE_P(InitiallyRestored,
329 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 329 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
330 Values(ui::SHOW_STATE_NORMAL)); 330 Values(ui::SHOW_STATE_NORMAL));
331 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, 331 INSTANTIATE_TEST_CASE_P(InitiallyMaximized,
332 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 332 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
333 Values(ui::SHOW_STATE_MAXIMIZED)); 333 Values(ui::SHOW_STATE_MAXIMIZED));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698