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

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

Issue 1921883002: Removes WindowState::aura_window() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows build Created 4 years, 8 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/aura/wm_window_aura.h"
9 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
10 #include "ash/wm/window_state_aura.h" 11 #include "ash/wm/window_state_aura.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "build/build_config.h" 14 #include "build/build_config.h"
14 #include "chrome/browser/apps/app_browsertest_util.h" 15 #include "chrome/browser/apps/app_browsertest_util.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_commands.h" 17 #include "chrome/browser/ui/browser_commands.h"
17 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
18 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 74
74 // When not in fullscreen, accelerators::ToggleMaximized toggles Maximized. 75 // When not in fullscreen, accelerators::ToggleMaximized toggles Maximized.
75 EXPECT_FALSE(window_state->IsMaximized()); 76 EXPECT_FALSE(window_state->IsMaximized());
76 ash::accelerators::ToggleMaximized(); 77 ash::accelerators::ToggleMaximized();
77 EXPECT_TRUE(window_state->IsMaximized()); 78 EXPECT_TRUE(window_state->IsMaximized());
78 ash::accelerators::ToggleMaximized(); 79 ash::accelerators::ToggleMaximized();
79 EXPECT_FALSE(window_state->IsMaximized()); 80 EXPECT_FALSE(window_state->IsMaximized());
80 81
81 // When in fullscreen accelerators::ToggleMaximized gets out of fullscreen. 82 // When in fullscreen accelerators::ToggleMaximized gets out of fullscreen.
82 EXPECT_FALSE(window_state->IsFullscreen()); 83 EXPECT_FALSE(window_state->IsFullscreen());
83 Browser* browser = chrome::FindBrowserWithWindow(window_state->aura_window()); 84 Browser* browser = chrome::FindBrowserWithWindow(
85 ash::wm::WmWindowAura::GetAuraWindow(window_state->window()));
84 ASSERT_TRUE(browser); 86 ASSERT_TRUE(browser);
85 chrome::ToggleFullscreenMode(browser); 87 chrome::ToggleFullscreenMode(browser);
86 EXPECT_TRUE(window_state->IsFullscreen()); 88 EXPECT_TRUE(window_state->IsFullscreen());
87 ash::accelerators::ToggleMaximized(); 89 ash::accelerators::ToggleMaximized();
88 EXPECT_FALSE(window_state->IsFullscreen()); 90 EXPECT_FALSE(window_state->IsFullscreen());
89 EXPECT_FALSE(window_state->IsMaximized()); 91 EXPECT_FALSE(window_state->IsMaximized());
90 ash::accelerators::ToggleMaximized(); 92 ash::accelerators::ToggleMaximized();
91 EXPECT_FALSE(window_state->IsFullscreen()); 93 EXPECT_FALSE(window_state->IsFullscreen());
92 EXPECT_TRUE(window_state->IsMaximized()); 94 EXPECT_TRUE(window_state->IsMaximized());
93 } 95 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 148
147 ash::accelerators::ToggleFullscreen(); 149 ash::accelerators::ToggleFullscreen();
148 EXPECT_TRUE(window_state->IsFullscreen()); 150 EXPECT_TRUE(window_state->IsFullscreen());
149 EXPECT_TRUE(IsInImmersiveFullscreen(window_state)); 151 EXPECT_TRUE(IsInImmersiveFullscreen(window_state));
150 152
151 ash::accelerators::ToggleFullscreen(); 153 ash::accelerators::ToggleFullscreen();
152 EXPECT_TRUE(IsInitialShowState(window_state)); 154 EXPECT_TRUE(IsInitialShowState(window_state));
153 155
154 // 2) ToggleFullscreen() should have no effect on windows which cannot be 156 // 2) ToggleFullscreen() should have no effect on windows which cannot be
155 // maximized. 157 // maximized.
156 window_state->aura_window()->SetProperty(aura::client::kCanMaximizeKey, 158 ash::wm::WmWindowAura::GetAuraWindow(window_state->window())
157 false); 159 ->SetProperty(aura::client::kCanMaximizeKey, false);
158 ash::accelerators::ToggleFullscreen(); 160 ash::accelerators::ToggleFullscreen();
159 EXPECT_TRUE(IsInitialShowState(window_state)); 161 EXPECT_TRUE(IsInitialShowState(window_state));
160 162
161 // 3) Hosted apps. 163 // 3) Hosted apps.
162 Browser::CreateParams browser_create_params( 164 Browser::CreateParams browser_create_params(
163 Browser::CreateParams::CreateForApp("Test", true /* trusted_source */, 165 Browser::CreateParams::CreateForApp("Test", true /* trusted_source */,
164 gfx::Rect(), browser()->profile())); 166 gfx::Rect(), browser()->profile()));
165 167
166 Browser* app_host_browser = new Browser(browser_create_params); 168 Browser* app_host_browser = new Browser(browser_create_params);
167 ASSERT_TRUE(app_host_browser->is_app()); 169 ASSERT_TRUE(app_host_browser->is_app());
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 CloseAppWindow(app_window); 328 CloseAppWindow(app_window);
327 } 329 }
328 } 330 }
329 331
330 INSTANTIATE_TEST_CASE_P(InitiallyRestored, 332 INSTANTIATE_TEST_CASE_P(InitiallyRestored,
331 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 333 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
332 Values(ui::SHOW_STATE_NORMAL)); 334 Values(ui::SHOW_STATE_NORMAL));
333 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, 335 INSTANTIATE_TEST_CASE_P(InitiallyMaximized,
334 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 336 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
335 Values(ui::SHOW_STATE_MAXIMIZED)); 337 Values(ui::SHOW_STATE_MAXIMIZED));
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698