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

Unified Diff: ash/test/display_manager_test_api.cc

Issue 11419271: Revert "Use WS_POPUP for ash_unittests" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/test/ash_test_base.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/display_manager_test_api.cc
diff --git a/ash/test/display_manager_test_api.cc b/ash/test/display_manager_test_api.cc
index 0f87b624b33633ff41ae88d5364e3d766de68d40..f068b64f5dd7c194ef1851843540d56cc83e22f7 100644
--- a/ash/test/display_manager_test_api.cc
+++ b/ash/test/display_manager_test_api.cc
@@ -41,6 +41,9 @@ 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)) {
@@ -54,21 +57,14 @@ 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) {
- // 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);
+ 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();
}
}
-
- display_manager_->SetDisplayIdsForTest(&displays);
- display_manager_->OnNativeDisplaysChanged(displays);
}
} // namespace test
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698