| 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());
|
| +}
|
|
|