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

Unified Diff: ash/test/ash_test_base.cc

Issue 10836065: Improve WorkspaceWindowResizer::CompleteDrag() so that the function moves the window to a root windo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 4 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
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 07f93d061b7ee077197e500eac5a45d6b040e157..e559833f26b13dd12124b64342372fd2f11f811a 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include "ash/display/display_controller.h"
#include "ash/shell.h"
#include "ash/test/test_shell_delegate.h"
#include "base/run_loop.h"
@@ -87,6 +88,20 @@ void AshTestBase::UpdateDisplay(const std::string& display_specs) {
std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
aura::Env::GetInstance()->display_manager()->
OnNativeDisplaysChanged(displays);
+
+ // On non-testing environment, when a secondary display is connected, a new
+ // native (i.e. X) window for the display is always created below the previous
+ // one for GPU performance reasons. Try to emulate the behavior.
+ if (internal::DisplayController::IsExtendedDesktopEnabled()) {
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ DCHECK_EQ(displays.size(), root_windows.size());
+ size_t next_y = 0;
+ for (size_t i = 0; i < root_windows.size(); ++i) {
+ const gfx::Size size = root_windows[i]->GetHostSize();
+ root_windows[i]->SetHostBounds(gfx::Rect(gfx::Point(0, next_y), size));
+ next_y += size.height();
+ }
+ }
}
void AshTestBase::RunAllPendingInMessageLoop() {
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698