OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 // updated. | 369 // updated. |
370 TEST_F(WorkspaceControllerTest, ShelfStateUpdated) { | 370 TEST_F(WorkspaceControllerTest, ShelfStateUpdated) { |
371 // Since ShelfLayoutManager queries for mouse location, move the mouse so | 371 // Since ShelfLayoutManager queries for mouse location, move the mouse so |
372 // it isn't over the shelf. | 372 // it isn't over the shelf. |
373 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 373 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
374 gfx::Point()); | 374 gfx::Point()); |
375 generator.MoveMouseTo(0, 0); | 375 generator.MoveMouseTo(0, 0); |
376 | 376 |
377 std::unique_ptr<Window> w1(CreateTestWindow()); | 377 std::unique_ptr<Window> w1(CreateTestWindow()); |
378 const gfx::Rect w1_bounds(0, 1, 101, 102); | 378 const gfx::Rect w1_bounds(0, 1, 101, 102); |
379 ShelfLayoutManager* shelf = shelf_layout_manager(); | 379 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
380 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 380 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
381 const gfx::Rect touches_shelf_bounds( | 381 const gfx::Rect touches_shelf_bounds( |
382 0, shelf->GetIdealBounds().y() - 10, 101, 102); | 382 0, shelf_layout_manager()->GetIdealBounds().y() - 10, 101, 102); |
383 // Move |w1| to overlap the shelf. | 383 // Move |w1| to overlap the shelf. |
384 w1->SetBounds(touches_shelf_bounds); | 384 w1->SetBounds(touches_shelf_bounds); |
385 EXPECT_FALSE(GetWindowOverlapsShelf()); | 385 EXPECT_FALSE(GetWindowOverlapsShelf()); |
386 | 386 |
387 // A visible ignored window should not trigger the overlap. | 387 // A visible ignored window should not trigger the overlap. |
388 std::unique_ptr<Window> w_ignored(CreateTestWindow()); | 388 std::unique_ptr<Window> w_ignored(CreateTestWindow()); |
389 w_ignored->SetBounds(touches_shelf_bounds); | 389 w_ignored->SetBounds(touches_shelf_bounds); |
390 wm::GetWindowState(&(*w_ignored))->set_ignored_by_shelf(true); | 390 wm::GetWindowState(&(*w_ignored))->set_ignored_by_shelf(true); |
391 w_ignored->Show(); | 391 w_ignored->Show(); |
392 EXPECT_FALSE(GetWindowOverlapsShelf()); | 392 EXPECT_FALSE(GetWindowOverlapsShelf()); |
393 | 393 |
394 // Make it visible, since visible shelf overlaps should be true. | 394 // Make it visible, since visible shelf overlaps should be true. |
395 w1->Show(); | 395 w1->Show(); |
396 EXPECT_TRUE(GetWindowOverlapsShelf()); | 396 EXPECT_TRUE(GetWindowOverlapsShelf()); |
397 | 397 |
398 wm::ActivateWindow(w1.get()); | 398 wm::ActivateWindow(w1.get()); |
399 w1->SetBounds(w1_bounds); | 399 w1->SetBounds(w1_bounds); |
400 w1->Show(); | 400 w1->Show(); |
401 wm::ActivateWindow(w1.get()); | 401 wm::ActivateWindow(w1.get()); |
402 | 402 |
403 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 403 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
404 | 404 |
405 // Maximize the window. | 405 // Maximize the window. |
406 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 406 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
407 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 407 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
408 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 408 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
409 | 409 |
410 // Restore. | 410 // Restore. |
411 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 411 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
412 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 412 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
413 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 413 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
414 | 414 |
415 // Fullscreen. | 415 // Fullscreen. |
416 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 416 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
417 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 417 EXPECT_EQ(SHELF_HIDDEN, shelf_layout_manager()->visibility_state()); |
418 | 418 |
419 // Normal. | 419 // Normal. |
420 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 420 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
421 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 421 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
422 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 422 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
423 EXPECT_FALSE(GetWindowOverlapsShelf()); | 423 EXPECT_FALSE(GetWindowOverlapsShelf()); |
424 | 424 |
425 // Move window so it obscures shelf. | 425 // Move window so it obscures shelf. |
426 w1->SetBounds(touches_shelf_bounds); | 426 w1->SetBounds(touches_shelf_bounds); |
427 EXPECT_TRUE(GetWindowOverlapsShelf()); | 427 EXPECT_TRUE(GetWindowOverlapsShelf()); |
428 | 428 |
429 // Move it back. | 429 // Move it back. |
430 w1->SetBounds(w1_bounds); | 430 w1->SetBounds(w1_bounds); |
431 EXPECT_FALSE(GetWindowOverlapsShelf()); | 431 EXPECT_FALSE(GetWindowOverlapsShelf()); |
432 | 432 |
433 // Maximize again. | 433 // Maximize again. |
434 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 434 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
435 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 435 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
436 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 436 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
437 | 437 |
438 // Minimize. | 438 // Minimize. |
439 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | 439 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
440 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 440 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
441 | 441 |
442 // Since the restore from minimize will restore to the pre-minimize | 442 // Since the restore from minimize will restore to the pre-minimize |
443 // state (tested elsewhere), we abandon the current size and restore | 443 // state (tested elsewhere), we abandon the current size and restore |
444 // rect and set them to the window. | 444 // rect and set them to the window. |
445 wm::WindowState* window_state = wm::GetWindowState(w1.get()); | 445 wm::WindowState* window_state = wm::GetWindowState(w1.get()); |
446 | 446 |
447 gfx::Rect restore = window_state->GetRestoreBoundsInScreen(); | 447 gfx::Rect restore = window_state->GetRestoreBoundsInScreen(); |
448 EXPECT_EQ("0,0 800x597", w1->bounds().ToString()); | 448 EXPECT_EQ("0,0 800x597", w1->bounds().ToString()); |
449 EXPECT_EQ("0,1 101x102", restore.ToString()); | 449 EXPECT_EQ("0,1 101x102", restore.ToString()); |
450 window_state->ClearRestoreBounds(); | 450 window_state->ClearRestoreBounds(); |
451 w1->SetBounds(restore); | 451 w1->SetBounds(restore); |
452 | 452 |
453 // Restore. | 453 // Restore. |
454 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 454 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
455 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 455 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
456 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 456 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
457 | 457 |
458 // Create another window, maximized. | 458 // Create another window, maximized. |
459 std::unique_ptr<Window> w2(CreateTestWindow()); | 459 std::unique_ptr<Window> w2(CreateTestWindow()); |
460 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); | 460 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); |
461 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 461 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
462 w2->Show(); | 462 w2->Show(); |
463 wm::ActivateWindow(w2.get()); | 463 wm::ActivateWindow(w2.get()); |
464 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 464 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
465 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 465 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
466 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 466 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
467 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent( | 467 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent( |
468 w2->parent()).ToString(), | 468 w2->parent()).ToString(), |
469 w2->bounds().ToString()); | 469 w2->bounds().ToString()); |
470 | 470 |
471 // Switch to w1. | 471 // Switch to w1. |
472 wm::ActivateWindow(w1.get()); | 472 wm::ActivateWindow(w1.get()); |
473 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 473 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
474 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 474 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
475 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent( | 475 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent( |
476 w2->parent()).ToString(), | 476 w2->parent()).ToString(), |
477 w2->bounds().ToString()); | 477 w2->bounds().ToString()); |
478 | 478 |
479 // Switch to w2. | 479 // Switch to w2. |
480 wm::ActivateWindow(w2.get()); | 480 wm::ActivateWindow(w2.get()); |
481 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 481 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager()->visibility_state()); |
482 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 482 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
483 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); | 483 EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
484 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent(w2.get()).ToString(), | 484 EXPECT_EQ(ScreenUtil::GetMaximizedWindowBoundsInParent(w2.get()).ToString(), |
485 w2->bounds().ToString()); | 485 w2->bounds().ToString()); |
486 | 486 |
487 // Turn off auto-hide, switch back to w2 (maximized) and verify overlap. | 487 // Turn off auto-hide, switch back to w2 (maximized) and verify overlap. |
488 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 488 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
489 wm::ActivateWindow(w2.get()); | 489 wm::ActivateWindow(w2.get()); |
490 EXPECT_FALSE(GetWindowOverlapsShelf()); | 490 EXPECT_FALSE(GetWindowOverlapsShelf()); |
491 | 491 |
492 // Move w1 to overlap shelf, it shouldn't change window overlaps shelf since | 492 // Move w1 to overlap shelf, it shouldn't change window overlaps shelf since |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
666 | 666 |
667 } // namespace | 667 } // namespace |
668 | 668 |
669 // Exercises possible crash in W2. Here's the sequence: | 669 // Exercises possible crash in W2. Here's the sequence: |
670 // . minimize a maximized window. | 670 // . minimize a maximized window. |
671 // . remove the window (which happens when switching displays). | 671 // . remove the window (which happens when switching displays). |
672 // . add the window back. | 672 // . add the window back. |
673 // . show the window and during the bounds change activate it. | 673 // . show the window and during the bounds change activate it. |
674 TEST_F(WorkspaceControllerTest, DontCrashOnChangeAndActivate) { | 674 TEST_F(WorkspaceControllerTest, DontCrashOnChangeAndActivate) { |
675 // Force the shelf | 675 // Force the shelf |
676 ShelfLayoutManager* shelf = shelf_layout_manager(); | 676 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
msw
2016/06/01 00:53:24
ditto nit: inline/cache consistency (in this file)
James Cook
2016/06/01 15:53:07
As above.
| |
677 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 677 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
678 | 678 |
679 DontCrashOnChangeAndActivateDelegate delegate; | 679 DontCrashOnChangeAndActivateDelegate delegate; |
680 std::unique_ptr<Window> w1(CreateTestWindowInShellWithDelegate( | 680 std::unique_ptr<Window> w1(CreateTestWindowInShellWithDelegate( |
681 &delegate, 1000, gfx::Rect(10, 11, 250, 251))); | 681 &delegate, 1000, gfx::Rect(10, 11, 250, 251))); |
682 | 682 |
683 w1->Show(); | 683 w1->Show(); |
684 wm::WindowState* w1_state = wm::GetWindowState(w1.get()); | 684 wm::WindowState* w1_state = wm::GetWindowState(w1.get()); |
685 w1_state->Activate(); | 685 w1_state->Activate(); |
686 w1_state->Maximize(); | 686 w1_state->Maximize(); |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1388 | 1388 |
1389 // Verifies that when dragging a window over the shelf overlap is detected | 1389 // Verifies that when dragging a window over the shelf overlap is detected |
1390 // during and after the drag. | 1390 // during and after the drag. |
1391 TEST_F(WorkspaceControllerTestDragging, DragWindowOverlapShelf) { | 1391 TEST_F(WorkspaceControllerTestDragging, DragWindowOverlapShelf) { |
1392 aura::test::TestWindowDelegate delegate; | 1392 aura::test::TestWindowDelegate delegate; |
1393 delegate.set_window_component(HTCAPTION); | 1393 delegate.set_window_component(HTCAPTION); |
1394 std::unique_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate( | 1394 std::unique_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate( |
1395 &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL)); | 1395 &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL)); |
1396 ParentWindowInPrimaryRootWindow(w1.get()); | 1396 ParentWindowInPrimaryRootWindow(w1.get()); |
1397 | 1397 |
1398 ShelfLayoutManager* shelf = shelf_layout_manager(); | 1398 Shelf::ForPrimaryDisplay()->SetAutoHideBehavior( |
1399 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 1399 SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
1400 | 1400 |
1401 // Drag near the shelf. | 1401 // Drag near the shelf. |
1402 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 1402 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
1403 gfx::Point()); | 1403 gfx::Point()); |
1404 generator.MoveMouseTo(10, 10); | 1404 generator.MoveMouseTo(10, 10); |
1405 generator.PressLeftButton(); | 1405 generator.PressLeftButton(); |
1406 generator.MoveMouseTo(100, shelf->GetIdealBounds().y() - 70); | 1406 generator.MoveMouseTo(100, shelf_layout_manager()->GetIdealBounds().y() - 70); |
1407 | 1407 |
1408 // Shelf should not be in overlapped state. | 1408 // Shelf should not be in overlapped state. |
1409 EXPECT_FALSE(GetWindowOverlapsShelf()); | 1409 EXPECT_FALSE(GetWindowOverlapsShelf()); |
1410 | 1410 |
1411 generator.MoveMouseTo(100, shelf->GetIdealBounds().y() - 20); | 1411 generator.MoveMouseTo(100, shelf_layout_manager()->GetIdealBounds().y() - 20); |
1412 | 1412 |
1413 // Shelf should detect overlap. Overlap state stays after mouse is released. | 1413 // Shelf should detect overlap. Overlap state stays after mouse is released. |
1414 EXPECT_TRUE(GetWindowOverlapsShelf()); | 1414 EXPECT_TRUE(GetWindowOverlapsShelf()); |
1415 generator.ReleaseLeftButton(); | 1415 generator.ReleaseLeftButton(); |
1416 EXPECT_TRUE(GetWindowOverlapsShelf()); | 1416 EXPECT_TRUE(GetWindowOverlapsShelf()); |
1417 } | 1417 } |
1418 | 1418 |
1419 // Verifies that when dragging a window autohidden shelf stays hidden during | 1419 // Verifies that when dragging a window autohidden shelf stays hidden during |
1420 // and after the drag. | 1420 // and after the drag. |
1421 TEST_F(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) { | 1421 TEST_F(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) { |
1422 aura::test::TestWindowDelegate delegate; | 1422 aura::test::TestWindowDelegate delegate; |
1423 delegate.set_window_component(HTCAPTION); | 1423 delegate.set_window_component(HTCAPTION); |
1424 std::unique_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate( | 1424 std::unique_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate( |
1425 &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL)); | 1425 &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL)); |
1426 ParentWindowInPrimaryRootWindow(w1.get()); | 1426 ParentWindowInPrimaryRootWindow(w1.get()); |
1427 | 1427 |
1428 ShelfLayoutManager* shelf = shelf_layout_manager(); | 1428 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
1429 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1429 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
1430 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 1430 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
1431 | 1431 |
1432 // Drag very little. | 1432 // Drag very little. |
1433 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 1433 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
1434 gfx::Point()); | 1434 gfx::Point()); |
1435 generator.MoveMouseTo(10, 10); | 1435 generator.MoveMouseTo(10, 10); |
1436 generator.PressLeftButton(); | 1436 generator.PressLeftButton(); |
1437 generator.MoveMouseTo(12, 12); | 1437 generator.MoveMouseTo(12, 12); |
1438 | 1438 |
1439 // Shelf should be hidden during and after the drag. | 1439 // Shelf should be hidden during and after the drag. |
1440 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 1440 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
1441 generator.ReleaseLeftButton(); | 1441 generator.ReleaseLeftButton(); |
1442 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 1442 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager()->auto_hide_state()); |
1443 } | 1443 } |
1444 | 1444 |
1445 // Verifies that events are targeted properly just outside the window edges. | 1445 // Verifies that events are targeted properly just outside the window edges. |
1446 TEST_F(WorkspaceControllerTest, WindowEdgeHitTest) { | 1446 TEST_F(WorkspaceControllerTest, WindowEdgeHitTest) { |
1447 aura::test::TestWindowDelegate d_first, d_second; | 1447 aura::test::TestWindowDelegate d_first, d_second; |
1448 std::unique_ptr<Window> first(aura::test::CreateTestWindowWithDelegate( | 1448 std::unique_ptr<Window> first(aura::test::CreateTestWindowWithDelegate( |
1449 &d_first, 123, gfx::Rect(20, 10, 100, 50), NULL)); | 1449 &d_first, 123, gfx::Rect(20, 10, 100, 50), NULL)); |
1450 ParentWindowInPrimaryRootWindow(first.get()); | 1450 ParentWindowInPrimaryRootWindow(first.get()); |
1451 first->Show(); | 1451 first->Show(); |
1452 | 1452 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1611 ui::EventTimeForNow()); | 1611 ui::EventTimeForNow()); |
1612 target = targeter->FindTargetForEvent(root, &touch); | 1612 target = targeter->FindTargetForEvent(root, &touch); |
1613 if (points[i].is_target_hit) | 1613 if (points[i].is_target_hit) |
1614 EXPECT_EQ(window.get(), target); | 1614 EXPECT_EQ(window.get(), target); |
1615 else | 1615 else |
1616 EXPECT_NE(window.get(), target); | 1616 EXPECT_NE(window.get(), target); |
1617 } | 1617 } |
1618 } | 1618 } |
1619 | 1619 |
1620 } // namespace ash | 1620 } // namespace ash |
OLD | NEW |