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

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

Issue 1662783002: Remove HostDesktopType from Browser::CreateParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-12
Patch Set: remove desktop_type_ in bookmark_bubble_sign_in_delegate 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 EXPECT_TRUE(IsInitialShowState(window_state)); 151 EXPECT_TRUE(IsInitialShowState(window_state));
152 152
153 // 2) ToggleFullscreen() should have no effect on windows which cannot be 153 // 2) ToggleFullscreen() should have no effect on windows which cannot be
154 // maximized. 154 // maximized.
155 window_state->window()->SetProperty(aura::client::kCanMaximizeKey, false); 155 window_state->window()->SetProperty(aura::client::kCanMaximizeKey, false);
156 ash::accelerators::ToggleFullscreen(); 156 ash::accelerators::ToggleFullscreen();
157 EXPECT_TRUE(IsInitialShowState(window_state)); 157 EXPECT_TRUE(IsInitialShowState(window_state));
158 158
159 // 3) Hosted apps. 159 // 3) Hosted apps.
160 Browser::CreateParams browser_create_params( 160 Browser::CreateParams browser_create_params(
161 Browser::CreateParams::CreateForApp("Test", 161 Browser::CreateParams::CreateForApp("Test", true /* trusted_source */,
162 true /* trusted_source */, 162 gfx::Rect(), browser()->profile()));
163 gfx::Rect(),
164 browser()->profile(),
165 chrome::HOST_DESKTOP_TYPE_ASH));
166 163
167 Browser* app_host_browser = new Browser(browser_create_params); 164 Browser* app_host_browser = new Browser(browser_create_params);
168 ASSERT_TRUE(app_host_browser->is_app()); 165 ASSERT_TRUE(app_host_browser->is_app());
169 AddBlankTabAndShow(app_host_browser); 166 AddBlankTabAndShow(app_host_browser);
170 window_state = 167 window_state =
171 ash::wm::GetWindowState(app_host_browser->window()->GetNativeWindow()); 168 ash::wm::GetWindowState(app_host_browser->window()->GetNativeWindow());
172 ASSERT_TRUE(window_state->IsActive()); 169 ASSERT_TRUE(window_state->IsActive());
173 SetToInitialShowState(window_state); 170 SetToInitialShowState(window_state);
174 EXPECT_TRUE(IsInitialShowState(window_state)); 171 EXPECT_TRUE(IsInitialShowState(window_state));
175 172
176 ash::accelerators::ToggleFullscreen(); 173 ash::accelerators::ToggleFullscreen();
177 EXPECT_TRUE(window_state->IsFullscreen()); 174 EXPECT_TRUE(window_state->IsFullscreen());
178 EXPECT_TRUE(IsInImmersiveFullscreen(window_state)); 175 EXPECT_TRUE(IsInImmersiveFullscreen(window_state));
179 176
180 ash::accelerators::ToggleFullscreen(); 177 ash::accelerators::ToggleFullscreen();
181 EXPECT_TRUE(IsInitialShowState(window_state)); 178 EXPECT_TRUE(IsInitialShowState(window_state));
182 179
183 // 4) Popup browser windows. 180 // 4) Popup browser windows.
184 browser_create_params = Browser::CreateParams( 181 browser_create_params =
185 Browser::TYPE_POPUP, browser()->profile(), chrome::HOST_DESKTOP_TYPE_ASH); 182 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile());
186 Browser* popup_browser = new Browser(browser_create_params); 183 Browser* popup_browser = new Browser(browser_create_params);
187 ASSERT_TRUE(popup_browser->is_type_popup()); 184 ASSERT_TRUE(popup_browser->is_type_popup());
188 ASSERT_FALSE(popup_browser->is_app()); 185 ASSERT_FALSE(popup_browser->is_app());
189 AddBlankTabAndShow(popup_browser); 186 AddBlankTabAndShow(popup_browser);
190 window_state = 187 window_state =
191 ash::wm::GetWindowState(popup_browser->window()->GetNativeWindow()); 188 ash::wm::GetWindowState(popup_browser->window()->GetNativeWindow());
192 ASSERT_TRUE(window_state->IsActive()); 189 ASSERT_TRUE(window_state->IsActive());
193 SetToInitialShowState(window_state); 190 SetToInitialShowState(window_state);
194 EXPECT_TRUE(IsInitialShowState(window_state)); 191 EXPECT_TRUE(IsInitialShowState(window_state));
195 192
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 CloseAppWindow(app_window); 324 CloseAppWindow(app_window);
328 } 325 }
329 } 326 }
330 327
331 INSTANTIATE_TEST_CASE_P(InitiallyRestored, 328 INSTANTIATE_TEST_CASE_P(InitiallyRestored,
332 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 329 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
333 Values(ui::SHOW_STATE_NORMAL)); 330 Values(ui::SHOW_STATE_NORMAL));
334 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, 331 INSTANTIATE_TEST_CASE_P(InitiallyMaximized,
335 AcceleratorCommandsPlatformAppFullscreenBrowserTest, 332 AcceleratorCommandsPlatformAppFullscreenBrowserTest,
336 Values(ui::SHOW_STATE_MAXIMIZED)); 333 Values(ui::SHOW_STATE_MAXIMIZED));
OLDNEW
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.cc ('k') | chrome/browser/ui/ash/chrome_new_window_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698