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

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

Issue 2629643002: chromeos: Renames WmWindowAura to WmWindow (Closed)
Patch Set: feedback Created 3 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
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/common/accelerators/accelerator_commands.h" 5 #include "ash/common/accelerators/accelerator_commands.h"
6 6
7 #include "ash/accelerators/accelerator_commands_aura.h" 7 #include "ash/accelerators/accelerator_commands_aura.h"
8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm_window.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/wm/window_state_aura.h" 11 #include "ash/wm/window_state_aura.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/apps/app_browsertest_util.h" 15 #include "chrome/browser/apps/app_browsertest_util.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_commands.h" 17 #include "chrome/browser/ui/browser_commands.h"
18 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // When not in fullscreen, accelerators::ToggleMaximized toggles Maximized. 67 // When not in fullscreen, accelerators::ToggleMaximized toggles Maximized.
68 EXPECT_FALSE(window_state->IsMaximized()); 68 EXPECT_FALSE(window_state->IsMaximized());
69 ash::accelerators::ToggleMaximized(); 69 ash::accelerators::ToggleMaximized();
70 EXPECT_TRUE(window_state->IsMaximized()); 70 EXPECT_TRUE(window_state->IsMaximized());
71 ash::accelerators::ToggleMaximized(); 71 ash::accelerators::ToggleMaximized();
72 EXPECT_FALSE(window_state->IsMaximized()); 72 EXPECT_FALSE(window_state->IsMaximized());
73 73
74 // When in fullscreen accelerators::ToggleMaximized gets out of fullscreen. 74 // When in fullscreen accelerators::ToggleMaximized gets out of fullscreen.
75 EXPECT_FALSE(window_state->IsFullscreen()); 75 EXPECT_FALSE(window_state->IsFullscreen());
76 Browser* browser = chrome::FindBrowserWithWindow( 76 Browser* browser = chrome::FindBrowserWithWindow(
77 ash::WmWindowAura::GetAuraWindow(window_state->window())); 77 ash::WmWindow::GetAuraWindow(window_state->window()));
78 ASSERT_TRUE(browser); 78 ASSERT_TRUE(browser);
79 chrome::ToggleFullscreenMode(browser); 79 chrome::ToggleFullscreenMode(browser);
80 EXPECT_TRUE(window_state->IsFullscreen()); 80 EXPECT_TRUE(window_state->IsFullscreen());
81 ash::accelerators::ToggleMaximized(); 81 ash::accelerators::ToggleMaximized();
82 EXPECT_FALSE(window_state->IsFullscreen()); 82 EXPECT_FALSE(window_state->IsFullscreen());
83 EXPECT_FALSE(window_state->IsMaximized()); 83 EXPECT_FALSE(window_state->IsMaximized());
84 ash::accelerators::ToggleMaximized(); 84 ash::accelerators::ToggleMaximized();
85 EXPECT_FALSE(window_state->IsFullscreen()); 85 EXPECT_FALSE(window_state->IsFullscreen());
86 EXPECT_TRUE(window_state->IsMaximized()); 86 EXPECT_TRUE(window_state->IsMaximized());
87 } 87 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 ash::accelerators::ToggleFullscreen(); 134 ash::accelerators::ToggleFullscreen();
135 EXPECT_TRUE(window_state->IsFullscreen()); 135 EXPECT_TRUE(window_state->IsFullscreen());
136 EXPECT_TRUE(IsInImmersiveFullscreen(window_state)); 136 EXPECT_TRUE(IsInImmersiveFullscreen(window_state));
137 137
138 ash::accelerators::ToggleFullscreen(); 138 ash::accelerators::ToggleFullscreen();
139 EXPECT_TRUE(IsInitialShowState(window_state)); 139 EXPECT_TRUE(IsInitialShowState(window_state));
140 140
141 // 2) ToggleFullscreen() should have no effect on windows which cannot be 141 // 2) ToggleFullscreen() should have no effect on windows which cannot be
142 // maximized. 142 // maximized.
143 ash::WmWindowAura::GetAuraWindow(window_state->window()) 143 ash::WmWindow::GetAuraWindow(window_state->window())
144 ->SetProperty(aura::client::kResizeBehaviorKey, 144 ->SetProperty(aura::client::kResizeBehaviorKey,
145 ui::mojom::kResizeBehaviorNone); 145 ui::mojom::kResizeBehaviorNone);
146 ash::accelerators::ToggleFullscreen(); 146 ash::accelerators::ToggleFullscreen();
147 EXPECT_TRUE(IsInitialShowState(window_state)); 147 EXPECT_TRUE(IsInitialShowState(window_state));
148 148
149 // 3) Hosted apps. 149 // 3) Hosted apps.
150 Browser::CreateParams browser_create_params( 150 Browser::CreateParams browser_create_params(
151 Browser::CreateParams::CreateForApp("Test", true /* trusted_source */, 151 Browser::CreateParams::CreateForApp("Test", true /* trusted_source */,
152 gfx::Rect(), browser()->profile())); 152 gfx::Rect(), browser()->profile()));
153 153
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 CloseAppWindow(app_window); 307 CloseAppWindow(app_window);
308 } 308 }
309 } 309 }
310 310
311 INSTANTIATE_TEST_CASE_P(InitiallyRestored, 311 INSTANTIATE_TEST_CASE_P(InitiallyRestored,
312 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 312 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
313 Values(ui::SHOW_STATE_NORMAL)); 313 Values(ui::SHOW_STATE_NORMAL));
314 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, 314 INSTANTIATE_TEST_CASE_P(InitiallyMaximized,
315 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 315 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
316 Values(ui::SHOW_STATE_MAXIMIZED)); 316 Values(ui::SHOW_STATE_MAXIMIZED));
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/ui/accessibility_cursor_ring_layer.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698