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

Unified Diff: chrome/browser/prefs/pref_service_browsertest.cc

Issue 11085053: Improving window auto management between workspaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed as requested. Corner cases will have to be addressed as they show 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/prefs/pref_service_browsertest.cc
diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc
index da3556add01dc330a4c33e808eb7ba9a41255b6e..1aca9477e1b45fad97972987c85cce1679dd7127 100644
--- a/chrome/browser/prefs/pref_service_browsertest.cc
+++ b/chrome/browser/prefs/pref_service_browsertest.cc
@@ -23,6 +23,10 @@
#include "chrome/test/base/ui_test_utils.h"
#include "ui/gfx/rect.h"
+#if defined(USE_ASH)
+#include "ash/wm/window_util.h"
+#endif
+
// On GTK, resizing happens asynchronously and we currently don't have a way to
// get called back (it's probably possible, but we don't have that code). Since
// the GTK code is going away, not spending more time on this.
@@ -31,14 +35,24 @@
typedef InProcessBrowserTest PreservedWindowPlacement;
IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, PRE_Test) {
+#if defined(USE_ASH)
+ // The window needs to be tagged as user positioned, otherwise it would get
+ // re-positioned.
+ ash::wm::SetUserHasChangedWindowPositionOrSize(
+ browser()->window()->GetNativeWindow(),
+ true);
+#endif
browser()->window()->SetBounds(gfx::Rect(20, 30, 400, 500));
}
IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, Test) {
gfx::Rect bounds = browser()->window()->GetBounds();
-
+#if defined(USE_ASH)
+ EXPECT_TRUE(ash::wm::HasUserChangedWindowPositionOrSize(
+ browser()->window()->GetNativeWindow()));
+#endif
gfx::Rect expected_bounds(gfx::Rect(20, 30, 400, 500));
- ASSERT_EQ(expected_bounds, bounds);
+ ASSERT_EQ(expected_bounds.ToString(), bounds.ToString());
}
#endif // defined(TOOLKIT_GTK)

Powered by Google App Engine
This is Rietveld 408576698