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

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

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Rebase Created 3 years, 10 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/browser_view_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc b/chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc
index 6dbcc82ef11eae7033c570de8fd60591e4530656..8daebb176c3d28ff0ea1d33bec28c27f1dd3d857 100644
--- a/chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc
@@ -45,88 +45,3 @@ IN_PROC_BROWSER_TEST_F(BrowserViewTest, MAYBE_FullscreenClearsFocus) {
// Focus is released from the location bar.
EXPECT_FALSE(location_bar_view->Contains(focus_manager->GetFocusedView()));
}
-
-#if defined(USE_AURA)
-namespace {
-
-class BrowserViewTestParam : public BrowserViewTest,
- public testing::WithParamInterface<bool> {
- public:
- bool TestApp() { return GetParam(); }
-};
-
-} // namespace
-
-// Test that docked state is remembered for app browser windows and not
-// remembered for tabbed browser windows.
-IN_PROC_BROWSER_TEST_P(BrowserViewTestParam, BrowserRemembersDockedState) {
-#if defined(USE_ASH)
- // Enable window docking for this test.
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- ash::switches::kAshEnableDockedWindows);
- const bool kIsAsh = true;
-#else
- const bool kIsAsh = false;
-#endif // defined(USE_ASH)
-
- // Open a new browser window (app or tabbed depending on a parameter).
- bool test_app = TestApp();
- Browser::CreateParams params =
- test_app ? Browser::CreateParams::CreateForApp(
- "test_browser_app", true /* trusted_source */, gfx::Rect(),
- browser()->profile(), true)
- : Browser::CreateParams(browser()->profile(), true);
- params.initial_show_state = ui::SHOW_STATE_DEFAULT;
-
- // Default |browser()| is not used by this test.
- browser()->window()->Close();
-
- // Create a new app browser
- Browser* browser = new Browser(params);
- gfx::NativeWindow window = browser->window()->GetNativeWindow();
- gfx::Rect original_bounds(gfx::Rect(150, 250, 400, 100));
- window->SetBounds(original_bounds);
- window->Show();
- // Dock the browser window using |kShowStateKey| property.
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_DOCKED);
-
- // Saved placement should reflect docked state (for app windows only in Ash).
- gfx::Rect bounds;
- ui::WindowShowState show_state = ui::SHOW_STATE_DEFAULT;
- const views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
- widget->widget_delegate()->GetSavedWindowPlacement(widget, &bounds,
- &show_state);
- EXPECT_EQ(kIsAsh && test_app ? ui::SHOW_STATE_DOCKED : ui::SHOW_STATE_DEFAULT,
- show_state);
- // Docking is only relevant on Ash desktop.
- if (!kIsAsh)
- return;
-
- // Newly created browser with the same app name should retain docked state
- // for app browser window but leave it as normal for a tabbed browser.
- browser = new Browser(params);
- browser->window()->Show();
- window = browser->window()->GetNativeWindow();
- EXPECT_EQ(test_app ? ui::SHOW_STATE_DOCKED : ui::SHOW_STATE_NORMAL,
- window->GetProperty(aura::client::kShowStateKey));
-
- // Undocking the browser window.
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
- EXPECT_EQ(ui::SHOW_STATE_NORMAL,
- window->GetProperty(aura::client::kShowStateKey));
- browser->window()->Close();
-
- // Re-create the browser window with the same app name.
- browser = new Browser(params);
- browser->window()->Show();
-
- // Newly created browser should retain undocked state.
- window = browser->window()->GetNativeWindow();
- EXPECT_EQ(ui::SHOW_STATE_NORMAL,
- window->GetProperty(aura::client::kShowStateKey));
-}
-
-INSTANTIATE_TEST_CASE_P(BrowserViewTestTabbedOrApp,
- BrowserViewTestParam,
- testing::Bool());
-#endif

Powered by Google App Engine
This is Rietveld 408576698