OLD | NEW |
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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 452 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
453 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 453 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
454 | 454 |
455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
456 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); | 456 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); |
457 } | 457 } |
458 | 458 |
459 // Tests that the cursor-filter is ahead of the drag-drop controller in the | 459 // Tests that the cursor-filter is ahead of the drag-drop controller in the |
460 // pre-target list. | 460 // pre-target list. |
461 TEST_F(ShellTest, TestPreTargetHandlerOrder) { | 461 TEST_F(ShellTest, TestPreTargetHandlerOrder) { |
| 462 // TODO: investigate failure in mash, http://crbug.com/695758. |
| 463 if (WmShell::Get()->IsRunningInMash()) |
| 464 return; |
| 465 |
462 Shell* shell = Shell::GetInstance(); | 466 Shell* shell = Shell::GetInstance(); |
463 ui::EventTargetTestApi test_api(shell); | 467 ui::EventTargetTestApi test_api(shell); |
464 test::ShellTestApi shell_test_api(shell); | 468 test::ShellTestApi shell_test_api(shell); |
465 | 469 |
466 const ui::EventHandlerList& handlers = test_api.pre_target_handlers(); | 470 const ui::EventHandlerList& handlers = test_api.pre_target_handlers(); |
467 ui::EventHandlerList::const_iterator cursor_filter = | 471 ui::EventHandlerList::const_iterator cursor_filter = |
468 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter()); | 472 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter()); |
469 ui::EventHandlerList::const_iterator drag_drop = std::find( | 473 ui::EventHandlerList::const_iterator drag_drop = std::find( |
470 handlers.begin(), handlers.end(), shell_test_api.drag_drop_controller()); | 474 handlers.begin(), handlers.end(), shell_test_api.drag_drop_controller()); |
471 EXPECT_NE(handlers.end(), cursor_filter); | 475 EXPECT_NE(handlers.end(), cursor_filter); |
(...skipping 24 matching lines...) Expand all Loading... |
496 ~ShellTest2() override {} | 500 ~ShellTest2() override {} |
497 | 501 |
498 protected: | 502 protected: |
499 std::unique_ptr<aura::Window> window_; | 503 std::unique_ptr<aura::Window> window_; |
500 | 504 |
501 private: | 505 private: |
502 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 506 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
503 }; | 507 }; |
504 | 508 |
505 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 509 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 510 // TODO: delete this test when conversion to mash is done. This test isn't |
| 511 // applicable to mash as all windows must be destroyed before ash, that isn't |
| 512 // the case with classic-ash where embedders can separately create |
| 513 // aura::Windows. |
| 514 if (WmShell::Get()->IsRunningInMash()) |
| 515 return; |
| 516 |
506 window_.reset(new aura::Window(NULL)); | 517 window_.reset(new aura::Window(NULL)); |
507 window_->Init(ui::LAYER_NOT_DRAWN); | 518 window_->Init(ui::LAYER_NOT_DRAWN); |
508 } | 519 } |
509 | 520 |
510 } // namespace ash | 521 } // namespace ash |
OLD | NEW |