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

Unified Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix other os's Created 8 years, 2 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
Index: ash/wm/workspace/workspace_window_resizer_unittest.cc
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 67f29fb2fb1c290940c0a9dc4c69c1270027e64d..d6f366e4ad2cc6d408794745dde97911d4a805ce 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -485,7 +485,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) {
ASSERT_EQ(2U, root_windows.size());
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
{
// Grab (0, 0) of the window.
@@ -503,7 +504,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) {
}
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
{
// Grab (0, 0) of the window and move the pointer to (790, 10).
@@ -519,7 +521,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) {
}
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
{
// Grab the top-right edge of the window and move the pointer to (0, 10)
@@ -569,7 +572,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_PhantomStyle) {
ASSERT_EQ(2U, root_windows.size());
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity());
{
@@ -620,7 +624,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_PhantomStyle) {
// Do the same test with RevertDrag().
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity());
{
@@ -644,7 +649,8 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_CancelSnapPhantom) {
ASSERT_EQ(2U, root_windows.size());
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
- gfx::Screen::GetPrimaryDisplay());
+ gfx::Screen::GetPrimaryDisplay(
+ ash::Shell::GetRootNativeView()));
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity());
{
@@ -768,7 +774,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottom) {
Shell::GetInstance()->SetDisplayWorkAreaInsets(
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 10, 0));
- ASSERT_EQ(1, gfx::Screen::GetNumDisplays());
+ ASSERT_EQ(1, gfx::Screen::GetNumDisplays(ash::Shell::GetRootNativeView()));
window_->SetBounds(gfx::Rect(100, 200, 300, 400));
scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
@@ -784,7 +790,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottom) {
// Makes sure we don't allow dragging on the work area with multidisplay.
TEST_F(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) {
UpdateDisplay("800x600,800x600");
- ASSERT_EQ(2, gfx::Screen::GetNumDisplays());
+ ASSERT_EQ(2, gfx::Screen::GetNumDisplays(ash::Shell::GetRootNativeView()));
Shell::GetInstance()->SetDisplayWorkAreaInsets(
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 10, 0));

Powered by Google App Engine
This is Rietveld 408576698