diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-01 01:48:45 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-01 01:48:45 +0000 |
commit | 52a49920649f6a29d17dc91b7101ff82b9a2ba96 (patch) | |
tree | 8e1b6b067018b19fb78669ae6c9d53725feefa63 /ash/test/display_manager_test_api.cc | |
parent | 7c083e491d5ce120b2864ae767230f56c55d3876 (diff) | |
download | chromium_src-52a49920649f6a29d17dc91b7101ff82b9a2ba96.zip chromium_src-52a49920649f6a29d17dc91b7101ff82b9a2ba96.tar.gz chromium_src-52a49920649f6a29d17dc91b7101ff82b9a2ba96.tar.bz2 |
Use WS_POPUP for ash_unittests
- Layout test windows starting from (1,1) and move
mouse to (0,0) so that they don't overlap unless
test moves the cursor.
- Enabled disabled tests.
- RootWindowHostWin::SetBounds should move the window
and call OnHostResized when the scale factor has changed.
This also seems to fix the desktop size limitation issue (148691)
probably because a popup window can be larger than the desktop size.
BUG=150986,157817,141577,148691
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11428066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test/display_manager_test_api.cc')
-rw-r--r-- | ash/test/display_manager_test_api.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ash/test/display_manager_test_api.cc b/ash/test/display_manager_test_api.cc index f068b64..0f87b62 100644 --- a/ash/test/display_manager_test_api.cc +++ b/ash/test/display_manager_test_api.cc @@ -41,9 +41,6 @@ DisplayManagerTestApi::~DisplayManagerTestApi() {} void DisplayManagerTestApi::UpdateDisplay( const std::string& display_specs) { std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); - display_manager_->SetDisplayIdsForTest(&displays); - display_manager_->OnNativeDisplaysChanged(displays); - bool is_host_origin_set = false; for (size_t i = 0; i < displays.size(); ++i) { if (displays[i].bounds_in_pixel().origin() != gfx::Point(0, 0)) { @@ -57,14 +54,21 @@ void DisplayManagerTestApi::UpdateDisplay( // previous one for GPU performance reasons. Try to emulate the behavior // unless host origins are explicitly set. if (!is_host_origin_set) { - Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - int 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(); + // Sart from (1,1) so that windows won't overlap with native mouse cursor. + // See |AshTestBase::SetUp()|. + int next_y = 1; + for (std::vector<gfx::Display>::iterator iter = displays.begin(); + iter != displays.end(); ++iter) { + gfx::Rect bounds(iter->GetSizeInPixel()); + bounds.set_x(1); + bounds.set_y(next_y); + next_y += bounds.height(); + iter->SetScaleAndBounds(iter->device_scale_factor(), bounds); } } + + display_manager_->SetDisplayIdsForTest(&displays); + display_manager_->OnNativeDisplaysChanged(displays); } } // namespace test |