OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
| 7 #include "apps/shell_window.h" |
7 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
10 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
11 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 14 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
16 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 typedef extensions::PlatformAppBrowserTest | 167 typedef extensions::PlatformAppBrowserTest |
167 ChromeShellDelegatePlatformAppBrowserTest; | 168 ChromeShellDelegatePlatformAppBrowserTest; |
168 | 169 |
169 // Test that ToggleFullscreen() toggles the platform app's fullscreen state. | 170 // Test that ToggleFullscreen() toggles the platform app's fullscreen state. |
170 IN_PROC_BROWSER_TEST_F(ChromeShellDelegatePlatformAppBrowserTest, | 171 IN_PROC_BROWSER_TEST_F(ChromeShellDelegatePlatformAppBrowserTest, |
171 ToggleFullscreenPlatformApp) { | 172 ToggleFullscreenPlatformApp) { |
172 ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate(); | 173 ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate(); |
173 ASSERT_TRUE(shell_delegate); | 174 ASSERT_TRUE(shell_delegate); |
174 | 175 |
175 const extensions::Extension* extension = LoadAndLaunchPlatformApp("minimal"); | 176 const extensions::Extension* extension = LoadAndLaunchPlatformApp("minimal"); |
176 ShellWindow* shell_window = CreateShellWindow(extension); | 177 apps::ShellWindow* shell_window = CreateShellWindow(extension); |
177 NativeAppWindow* app_window = shell_window->GetBaseWindow(); | 178 NativeAppWindow* app_window = shell_window->GetBaseWindow(); |
178 ASSERT_TRUE(shell_window->GetBaseWindow()->IsActive()); | 179 ASSERT_TRUE(shell_window->GetBaseWindow()->IsActive()); |
179 EXPECT_FALSE(app_window->IsMaximized()); | 180 EXPECT_FALSE(app_window->IsMaximized()); |
180 EXPECT_FALSE(app_window->IsFullscreen()); | 181 EXPECT_FALSE(app_window->IsFullscreen()); |
181 | 182 |
182 shell_delegate->ToggleFullscreen(); | 183 shell_delegate->ToggleFullscreen(); |
183 EXPECT_TRUE(app_window->IsFullscreen()); | 184 EXPECT_TRUE(app_window->IsFullscreen()); |
184 | 185 |
185 shell_delegate->ToggleFullscreen(); | 186 shell_delegate->ToggleFullscreen(); |
186 EXPECT_FALSE(app_window->IsMaximized()); | 187 EXPECT_FALSE(app_window->IsMaximized()); |
187 EXPECT_FALSE(app_window->IsFullscreen()); | 188 EXPECT_FALSE(app_window->IsFullscreen()); |
188 | 189 |
189 CloseShellWindow(shell_window); | 190 CloseShellWindow(shell_window); |
190 } | 191 } |
OLD | NEW |