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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc

Issue 25536010: Make packaged apps use AppNonClientFrameViewAsh when maximized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
index b06b048ec9fe8f24d2171dcde7600b1c9cb7c5b1..c0fe1647c6c6687152b207eb77ed13484f924e66 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/immersive_fullscreen_configuration.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "ui/aura/client/aura_constants.h"
@@ -164,10 +165,22 @@ IN_PROC_BROWSER_TEST_F(ChromeShellDelegateBrowserTest, ToggleFullscreen) {
EXPECT_FALSE(browser_window->IsFullscreen());
}
-typedef extensions::PlatformAppBrowserTest
- ChromeShellDelegatePlatformAppBrowserTest;
+class ChromeShellDelegatePlatformAppBrowserTest
+ : public extensions::PlatformAppBrowserTest {
+ public:
+ ChromeShellDelegatePlatformAppBrowserTest() {}
+ virtual ~ChromeShellDelegatePlatformAppBrowserTest() {}
-// Test that ToggleFullscreen() toggles the platform app's fullscreen state.
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch(switches::kOpenAsh);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegatePlatformAppBrowserTest);
+};
+
+// Test the behavior of ToggleFullscreen() with packaged apps.
IN_PROC_BROWSER_TEST_F(ChromeShellDelegatePlatformAppBrowserTest,
ToggleFullscreenPlatformApp) {
ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate();
@@ -181,11 +194,17 @@ IN_PROC_BROWSER_TEST_F(ChromeShellDelegatePlatformAppBrowserTest,
EXPECT_FALSE(app_window->IsFullscreen());
shell_delegate->ToggleFullscreen();
- EXPECT_TRUE(app_window->IsFullscreen());
-
- shell_delegate->ToggleFullscreen();
- EXPECT_FALSE(app_window->IsMaximized());
- EXPECT_FALSE(app_window->IsFullscreen());
+ // If packaged app uses the same frame as hosted apps, ToggleFullscreen()
+ // should maximize the app.
+ if (ash::switches::UseSameFrameForV1AndV2Apps()) {
+ EXPECT_TRUE(app_window->IsMaximized());
+ } else {
+ EXPECT_TRUE(app_window->IsFullscreen());
+
+ shell_delegate->ToggleFullscreen();
+ EXPECT_FALSE(app_window->IsMaximized());
+ EXPECT_FALSE(app_window->IsFullscreen());
+ }
CloseShellWindow(shell_window);
}
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/views/apps/native_app_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698