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

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

Issue 11082002: Remove TOGGLE_MAXIMIZED_* from Ash reserved actions list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ash::wm::ToggleMaximizedWindow to window_util.h Created 8 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/views/accelerator_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..26946ebdf1b14c7fbfe4a3af39af65d13ab7126c
--- /dev/null
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
+
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
+#include "ash/wm/window_util.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_commands.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/test/base/in_process_browser_test.h"
+
+typedef InProcessBrowserTest ChromeShellDelegateBrowserTest;
+
+// Confirm that toggling window miximized works properly
+IN_PROC_BROWSER_TEST_F(ChromeShellDelegateBrowserTest, ToggleMaximized) {
+ ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate();
+ ASSERT_TRUE(shell_delegate);
+
+ // When not in fullscreen, ShellDelegate::ToggleMaximized toggles Maximized.
+ aura::Window* window = ash::wm::GetActiveWindow();
+ EXPECT_FALSE(ash::wm::IsWindowMaximized(window));
+ shell_delegate->ToggleMaximized();
+ EXPECT_TRUE(ash::wm::IsWindowMaximized(window));
+ shell_delegate->ToggleMaximized();
+ EXPECT_FALSE(ash::wm::IsWindowMaximized(window));
+
+ // When in fullscreen ShellDelegate::ToggleMaximized gets out of fullscreen.
+ EXPECT_FALSE(ash::wm::IsWindowFullscreen(window));
+ Browser* browser = browser::FindBrowserWithWindow(window);
+ ASSERT_TRUE(browser);
+ chrome::ToggleFullscreenMode(browser);
+ EXPECT_TRUE(ash::wm::IsWindowFullscreen(window));
+ shell_delegate->ToggleMaximized();
+ EXPECT_FALSE(ash::wm::IsWindowFullscreen(window));
+ EXPECT_FALSE(ash::wm::IsWindowMaximized(window));
+ shell_delegate->ToggleMaximized();
+ EXPECT_FALSE(ash::wm::IsWindowFullscreen(window));
+ EXPECT_TRUE(ash::wm::IsWindowMaximized(window));
+}
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/views/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698