| Index: chrome/browser/ui/views/frame/app_browser_frame_view_ash_browsertest.cc
|
| diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/app_browser_frame_view_ash_browsertest.cc
|
| similarity index 84%
|
| rename from chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc
|
| rename to chrome/browser/ui/views/frame/app_browser_frame_view_ash_browsertest.cc
|
| index dcf54e88ce193d3d9757ef401ef88759c1f9be51..823e413d3f8e1d106ec460c1be2eac72c5bcf5de 100644
|
| --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash_browsertest.cc
|
| +++ b/chrome/browser/ui/views/frame/app_browser_frame_view_ash_browsertest.cc
|
| @@ -2,13 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "ash/wm/caption_buttons/hideable_caption_button_container.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/browser/ui/browser_list.h"
|
| #include "chrome/browser/ui/browser_tabstrip.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| -#include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h"
|
| +#include "chrome/browser/ui/views/frame/app_browser_frame_view_ash.h"
|
| #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
|
| #include "chrome/browser/ui/views/frame/browser_view.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| @@ -50,11 +51,11 @@ void RestoreWindow(Window* window) {
|
|
|
| } // namespace
|
|
|
| -class AppNonClientFrameViewAshTest : public InProcessBrowserTest {
|
| +class AppBrowserFrameViewAshTest : public InProcessBrowserTest {
|
| public:
|
| - AppNonClientFrameViewAshTest() : InProcessBrowserTest(), app_browser_(NULL) {
|
| + AppBrowserFrameViewAshTest() : InProcessBrowserTest(), app_browser_(NULL) {
|
| }
|
| - virtual ~AppNonClientFrameViewAshTest() {}
|
| + virtual ~AppBrowserFrameViewAshTest() {}
|
|
|
| virtual void SetUpOnMainThread() OVERRIDE {
|
| Browser::CreateParams params = Browser::CreateParams::CreateForApp(
|
| @@ -97,10 +98,10 @@ class AppNonClientFrameViewAshTest : public InProcessBrowserTest {
|
| // Ensure that restoring the app window replaces the frame with a normal one,
|
| // and maximizing again brings back the app frame. This has been the source of
|
| // some crash bugs like crbug.com/155634
|
| -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SwitchFrames) {
|
| +IN_PROC_BROWSER_TEST_F(AppBrowserFrameViewAshTest, SwitchFrames) {
|
| // Convert to std::string so Windows can match EXPECT_EQ.
|
| const std::string kAppFrameClassName =
|
| - AppNonClientFrameViewAsh::kViewClassName;
|
| + AppBrowserFrameViewAsh::kViewClassName;
|
| const std::string kNormalFrameClassName =
|
| BrowserNonClientFrameViewAsh::kViewClassName;
|
|
|
| @@ -136,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SwitchFrames) {
|
|
|
| // Ensure that we can click the close button when the controls are shown.
|
| // In particular make sure that we can click it on the top pixel of the button.
|
| -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ClickClose) {
|
| +IN_PROC_BROWSER_TEST_F(AppBrowserFrameViewAshTest, ClickClose) {
|
| aura::RootWindow* root_window = GetRootWindow();
|
| aura::test::EventGenerator eg(root_window, gfx::Point(0, 1));
|
|
|
| @@ -148,12 +149,12 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ClickClose) {
|
| eg.ClickLeftButton();
|
| signal.Wait();
|
| EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
|
| - browser()->host_desktop_type()));
|
| + browser()->host_desktop_type()));
|
| }
|
|
|
| // Ensure that closing a maximized app with Ctrl-W does not crash the
|
| // application. crbug.com/147635
|
| -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, KeyboardClose) {
|
| +IN_PROC_BROWSER_TEST_F(AppBrowserFrameViewAshTest, KeyboardClose) {
|
| aura::RootWindow* root_window = GetRootWindow();
|
| aura::test::EventGenerator eg(root_window);
|
|
|
| @@ -175,14 +176,16 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, KeyboardClose) {
|
| }
|
|
|
| // Ensure that snapping left with Alt-[ closes the control window.
|
| -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SnapLeftClosesControls) {
|
| +IN_PROC_BROWSER_TEST_F(AppBrowserFrameViewAshTest, SnapLeftClosesControls) {
|
| + const char* kControlWindowName =
|
| + ash::HideableCaptionButtonContainer::kButtonWindowName;
|
| +
|
| aura::RootWindow* root_window = GetRootWindow();
|
| aura::test::EventGenerator eg(root_window);
|
| aura::Window* native_window = app_browser()->window()->GetNativeWindow();
|
|
|
| // Control window exists.
|
| - EXPECT_TRUE(HasChildWindowNamed(
|
| - native_window, AppNonClientFrameViewAsh::kControlWindowName));
|
| + EXPECT_TRUE(HasChildWindowNamed(native_window, kControlWindowName));
|
|
|
| // Send Alt-[
|
| eg.PressKey(ui::VKEY_OEM_4, ui::EF_ALT_DOWN);
|
| @@ -190,12 +193,14 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, SnapLeftClosesControls) {
|
| content::RunAllPendingInMessageLoop();
|
|
|
| // Control window is gone.
|
| - EXPECT_FALSE(HasChildWindowNamed(
|
| - native_window, AppNonClientFrameViewAsh::kControlWindowName));
|
| + EXPECT_FALSE(HasChildWindowNamed(native_window, kControlWindowName));
|
| }
|
|
|
| // Ensure that the controls are at the proper locations.
|
| -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ControlsAtRightSide) {
|
| +IN_PROC_BROWSER_TEST_F(AppBrowserFrameViewAshTest, ControlsAtRightSide) {
|
| + const char* kControlWindowName =
|
| + ash::HideableCaptionButtonContainer::kButtonWindowName;
|
| +
|
| aura::RootWindow* root_window = GetRootWindow();
|
| aura::test::EventGenerator eg(root_window);
|
| aura::Window* native_window = app_browser()->window()->GetNativeWindow();
|
| @@ -203,8 +208,7 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ControlsAtRightSide) {
|
| gfx::Screen::GetScreenFor(native_window)->GetPrimaryDisplay().work_area();
|
|
|
| // Control window exists.
|
| - aura::Window* window = GetChildWindowNamed(
|
| - native_window, AppNonClientFrameViewAsh::kControlWindowName);
|
| + aura::Window* window = GetChildWindowNamed(native_window, kControlWindowName);
|
|
|
| ASSERT_TRUE(window);
|
| gfx::Rect rect = window->bounds();
|
| @@ -213,15 +217,14 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAshTest, ControlsAtRightSide) {
|
|
|
| MinimizeWindow(native_window);
|
| content::RunAllPendingInMessageLoop();
|
| - window = GetChildWindowNamed(
|
| - native_window, AppNonClientFrameViewAsh::kControlWindowName);
|
| + window = GetChildWindowNamed(native_window, kControlWindowName);
|
| EXPECT_FALSE(window);
|
| MaximizeWindow(native_window);
|
| content::RunAllPendingInMessageLoop();
|
|
|
| // Control window exists.
|
| aura::Window* window_after = GetChildWindowNamed(
|
| - native_window, AppNonClientFrameViewAsh::kControlWindowName);
|
| + native_window, kControlWindowName);
|
| ASSERT_TRUE(window_after);
|
| gfx::Rect rect_after = window_after->bounds();
|
| EXPECT_EQ(work_area.right(), rect_after.right());
|
|
|