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

Unified Diff: ash/test/ash_test_base.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 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/system/tray_display.cc ('k') | ash/wm/system_gesture_event_filter_unittest.cc » ('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 80c92a6f5fff20fbbf4d0880888529ebdc189082..1676d36733019f1f4b292e5d2a6378442f035d74 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "ash/display/display_controller.h"
+#include "ash/display/multi_display_manager.h"
#include "ash/shell.h"
#include "ash/test/test_shell_delegate.h"
#include "base/run_loop.h"
@@ -58,7 +59,10 @@ void AshTestBase::SetUp() {
TestShellDelegate* delegate = new TestShellDelegate;
ash::Shell::CreateInstance(delegate);
Shell::GetPrimaryRootWindow()->Show();
- Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600));
+ // Move the mouse cursor to far away so that native events doesn't
+ // interfere test expectations.
+ Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
+ UpdateDisplay("800x600");
Shell::GetInstance()->cursor_manager()->ShowCursor(true);
// Disable animations during tests.
@@ -87,8 +91,11 @@ void AshTestBase::ChangeDisplayConfig(float scale,
void AshTestBase::UpdateDisplay(const std::string& display_specs) {
std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
- aura::Env::GetInstance()->display_manager()->
- OnNativeDisplaysChanged(displays);
+ internal::MultiDisplayManager* display_manager =
+ static_cast<internal::MultiDisplayManager*>(
+ aura::Env::GetInstance()->display_manager());
+ display_manager->SetDisplayIdsForTest(&displays);
+ 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
« no previous file with comments | « ash/system/tray_display.cc ('k') | ash/wm/system_gesture_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698