summaryrefslogtreecommitdiffstats
path: root/ash/test
diff options
context:
space:
mode:
authoryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 07:12:48 +0000
committeryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 07:12:48 +0000
commite79f26e79c7a547daea7ffb9fed3755b82641077 (patch)
treeab87a149931ec4161eb0f0acbdccae8e7be0631f /ash/test
parent3b6bd997382b2a8a3d8bbfb3cf70a10f4e011de6 (diff)
downloadchromium_src-e79f26e79c7a547daea7ffb9fed3755b82641077.zip
chromium_src-e79f26e79c7a547daea7ffb9fed3755b82641077.tar.gz
chromium_src-e79f26e79c7a547daea7ffb9fed3755b82641077.tar.bz2
Improve WorkspaceWindowResizer::CompleteDrag() so that the function moves the window to a root window where the cursor is currently on.
This CL depends on http://codereview.chromium.org/10834097/ . BUG=136816 TEST=try Review URL: https://chromiumcodereview.appspot.com/10836065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r--ash/test/ash_test_base.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 07f93d0..e559833 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() {