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

Side by Side Diff: ash/extended_desktop_unittest.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 #include "ash/display/multi_display_manager.h" 6 #include "ash/display/multi_display_manager.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); 346 aura::client::GetCaptureWindow(r2_w1->GetRootWindow()));
347 generator2.MoveMouseBy(10, 10); 347 generator2.MoveMouseBy(10, 10);
348 generator2.ClickLeftButton(); 348 generator2.ClickLeftButton();
349 EXPECT_EQ("0 0 0", r2_d1.GetMouseMotionCountsAndReset()); 349 EXPECT_EQ("0 0 0", r2_d1.GetMouseMotionCountsAndReset());
350 EXPECT_EQ("0 0", r2_d1.GetMouseButtonCountsAndReset()); 350 EXPECT_EQ("0 0", r2_d1.GetMouseButtonCountsAndReset());
351 // mouse is already entered. 351 // mouse is already entered.
352 EXPECT_EQ("0 1 0", r1_d2.GetMouseMotionCountsAndReset()); 352 EXPECT_EQ("0 1 0", r1_d2.GetMouseMotionCountsAndReset());
353 EXPECT_EQ("1 1", r1_d2.GetMouseButtonCountsAndReset()); 353 EXPECT_EQ("1 1", r1_d2.GetMouseButtonCountsAndReset());
354 354
355 r1_w2->ReleaseCapture(); 355 r1_w2->ReleaseCapture();
356 EXPECT_EQ(NULL, 356 EXPECT_EQ(NULL, aura::client::GetCaptureWindow(r2_w1->GetRootWindow()));
357 aura::client::GetCaptureWindow(r2_w1->GetRootWindow()));
358 generator2.MoveMouseTo(15, 15); 357 generator2.MoveMouseTo(15, 15);
359 generator2.ClickLeftButton(); 358 generator2.ClickLeftButton();
360 EXPECT_EQ("1 1 0", r2_d1.GetMouseMotionCountsAndReset()); 359 EXPECT_EQ("1 1 0", r2_d1.GetMouseMotionCountsAndReset());
361 EXPECT_EQ("1 1", r2_d1.GetMouseButtonCountsAndReset()); 360 EXPECT_EQ("1 1", r2_d1.GetMouseButtonCountsAndReset());
362 // Make sure the mouse_moved_handler_ is properly reset. 361 // Make sure the mouse_moved_handler_ is properly reset.
363 EXPECT_EQ("0 0 0", r1_d2.GetMouseMotionCountsAndReset()); 362 // One mouse exited is issued when capture is released.
363 EXPECT_EQ("0 0 1", r1_d2.GetMouseMotionCountsAndReset());
364 EXPECT_EQ("0 0", r1_d2.GetMouseButtonCountsAndReset()); 364 EXPECT_EQ("0 0", r1_d2.GetMouseButtonCountsAndReset());
365 } 365 }
366 366
367 TEST_F(ExtendedDesktopTest, MoveWindow) { 367 TEST_F(ExtendedDesktopTest, MoveWindow) {
368 UpdateDisplay("1000x600,600x400"); 368 UpdateDisplay("1000x600,600x400");
369 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 369 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
370 views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); 370 views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
371 371
372 EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow()); 372 EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow());
373 373
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 EXPECT_FALSE(tray->HasSystemBubble()); 565 EXPECT_FALSE(tray->HasSystemBubble());
566 566
567 UpdateDisplay("100x600"); 567 UpdateDisplay("100x600");
568 EXPECT_FALSE(tray->HasSystemBubble()); 568 EXPECT_FALSE(tray->HasSystemBubble());
569 UpdateDisplay("100x600,600x400"); 569 UpdateDisplay("100x600,600x400");
570 EXPECT_FALSE(tray->HasSystemBubble()); 570 EXPECT_FALSE(tray->HasSystemBubble());
571 } 571 }
572 572
573 } // namespace internal 573 } // namespace internal
574 } // namespace ash 574 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698