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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc

Issue 11085053: Improving window auto management between workspaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a part of the change which slipped in through a branch switch and eclipse usage 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
Index: chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
index b59d82c632333787029ebce69a21c5252434a223..8ee2ea32ebccbf7a3713c6efc63c96a75b3d891c 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -38,6 +38,7 @@
#include "ash/shell.h"
#include "ash/test/cursor_manager_test_api.h"
#include "ash/wm/cursor_manager.h"
+#include "ash/wm/window_util.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/root_window.h"
#endif
@@ -399,6 +400,22 @@ void DetachToOwnWindowStep2(DetachToBrowserTabDragControllerTest* test) {
ASSERT_TRUE(test->ReleaseInput());
}
+#if defined(USE_ASH)
+bool IsWindowPositionManaged(aura::Window* window) {
+ return ash::wm::IsWindowPositionManaged(window);
+}
+bool HasUserChangedWindowPositionOrSize(aura::Window* window) {
+ return ash::wm::HasUserChangedWindowPositionOrSize(window);
+}
+#else
+bool IsWindowPositionManaged(gfx::NativeWindow window) {
+ return true;
+}
+bool HasUserChangedWindowPositionOrSize(gfx::NativeWindow window) {
+ return false;
+}
+#endif
+
} // namespace
// Drags from browser to separate window and releases mouse.
@@ -441,6 +458,10 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
EXPECT_TRUE(GetTrackedByWorkspace(browser()));
EXPECT_TRUE(GetTrackedByWorkspace(new_browser));
+ // After this both windows should still be managable.
+ EXPECT_TRUE(IsWindowPositionManaged(browser()->window()->GetNativeWindow()));
+ EXPECT_TRUE(IsWindowPositionManaged(
+ new_browser->window()->GetNativeWindow()));
}
// Deletes a tab being dragged before the user moved enough to start a drag.
@@ -856,6 +877,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
// Create another browser.
Browser* browser2 = CreateAnotherWindowBrowserAndRelayout();
TabStrip* tab_strip2 = GetTabStripForBrowser(browser2);
+ const gfx::Rect initial_bounds(browser2->window()->GetBounds());
// Move to the first tab and drag it enough so that it detaches, but not
// enough that it attaches to browser2.
@@ -879,6 +901,13 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
EXPECT_EQ("100 0", IDString(browser2->tab_strip_model()));
EXPECT_TRUE(GetTrackedByWorkspace(browser2));
+ // Make sure that the window is still managed and not user moved.
+ EXPECT_TRUE(IsWindowPositionManaged(browser2->window()->GetNativeWindow()));
+ EXPECT_FALSE(HasUserChangedWindowPositionOrSize(
+ browser2->window()->GetNativeWindow()));
+ // Also make sure that the drag to window position has not changed.
+ EXPECT_EQ(initial_bounds.ToString(),
+ browser2->window()->GetBounds().ToString());
}
namespace {
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698