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

Unified Diff: ash/screen_util_unittest.cc

Issue 1116313002: Layout login/lock screen, shelf and app list inside the first display in Unified Desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/screen_util.cc ('k') | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_util_unittest.cc
diff --git a/ash/screen_util_unittest.cc b/ash/screen_util_unittest.cc
index 9ab36005d8b9dccdb19085590b7731f87efb4256..741044fd90c0e104570fd9eaec46215bc746f8d4 100644
--- a/ash/screen_util_unittest.cc
+++ b/ash/screen_util_unittest.cc
@@ -4,11 +4,13 @@
#include "ash/screen_util.h"
+#include "ash/display/display_manager.h"
#include "ash/root_window_controller.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
+#include "ash/test/display_manager_test_api.h"
#include "ash/wm/window_util.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
@@ -112,5 +114,37 @@ TEST_F(ScreenUtilTest, ConvertRect) {
secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString());
}
+TEST_F(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) {
+ if (!SupportsMultipleDisplays())
+ return;
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ DisplayManagerTestApi test_api(display_manager);
+ test_api.SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
+ display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED);
+
+ views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
+ NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100));
+
+ UpdateDisplay("500x400");
+ EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen(
+ widget->GetNativeWindow()).ToString());
+
+ UpdateDisplay("500x400,600x400");
+ EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen(
+ widget->GetNativeWindow()).ToString());
+
+ // Move to the 2nd physical display. Shelf's display still should be
+ // the first.
+ widget->SetBounds(gfx::Rect(800, 0, 100, 100));
+ ASSERT_EQ("800,0 100x100", widget->GetWindowBoundsInScreen().ToString());
+
+ EXPECT_EQ("0,0 500x400", ScreenUtil::GetShelfDisplayBoundsInScreen(
+ widget->GetNativeWindow()).ToString());
+
+ UpdateDisplay("600x500");
+ EXPECT_EQ("0,0 600x500", ScreenUtil::GetShelfDisplayBoundsInScreen(
+ widget->GetNativeWindow()).ToString());
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/screen_util.cc ('k') | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698