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

Unified Diff: chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc

Issue 10986003: Fixed problem with disappearing window controls for applications when maximizing / minimizing / max… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/views/frame/app_non_client_frame_view_aura_browsertest.cc
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
index 46de1bf2b7cb310acf0e5250eda3dfb8dcd69ff5..4fe508e240d88075fed9cdbd3285ff122913cd85 100644
--- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
+++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ash/wm/window_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
@@ -20,13 +21,17 @@ using aura::Window;
namespace {
-bool HasChildWindowNamed(Window* window, const char* name) {
+Window* GetChildWindowNamed(Window* window, const char* name) {
for (size_t i = 0; i < window->children().size(); ++i) {
Window* child = window->children()[i];
if (child->name() == name)
- return true;
+ return child;
}
- return false;
+ return NULL;
+}
+
+bool HasChildWindowNamed(Window* window, const char* name) {
+ return GetChildWindowNamed(window, name) != NULL;
}
} // namespace
@@ -129,3 +134,35 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, SnapLeftClosesControls) {
EXPECT_FALSE(HasChildWindowNamed(
native_window, AppNonClientFrameViewAura::kControlWindowName));
}
+
+// Ensure that the controls are at the proper locations.
+IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, ControlsAtRightSide) {
+ aura::RootWindow* root_window = GetRootWindow();
+ aura::test::EventGenerator eg(root_window);
+ aura::Window* native_window = app_browser()->window()->GetNativeWindow();
+
+ // Control window exists.
+ aura::Window* window = GetChildWindowNamed(
+ native_window, AppNonClientFrameViewAura::kControlWindowName);
+
+ EXPECT_TRUE(window);
+ gfx::Rect rect = window->bounds();
+ EXPECT_EQ(1280, rect.right());
+ EXPECT_EQ(0, rect.y());
+
+ ash::wm::MinimizeWindow(native_window);
+ content::RunAllPendingInMessageLoop();
+ window = GetChildWindowNamed(
+ native_window, AppNonClientFrameViewAura::kControlWindowName);
+ EXPECT_FALSE(window);
+ ash::wm::MaximizeWindow(native_window);
+ content::RunAllPendingInMessageLoop();
+
+ // Control window exists.
+ window = GetChildWindowNamed(
+ native_window, AppNonClientFrameViewAura::kControlWindowName);
+ EXPECT_TRUE(window);
+ rect = window->bounds();
+ EXPECT_EQ(1280, rect.right());
+ EXPECT_EQ(0, rect.y());
+}

Powered by Google App Engine
This is Rietveld 408576698