OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/wm/core/transient_window_manager.h" | 5 #include "ui/wm/core/transient_window_manager.h" |
6 | 6 |
7 #include "ui/aura/client/visibility_client.h" | 7 #include "ui/aura/client/visibility_client.h" |
8 #include "ui/aura/client/window_tree_client.h" | 8 #include "ui/aura/client/window_tree_client.h" |
9 #include "ui/aura/layout_manager.h" | 9 #include "ui/aura/layout_manager.h" |
10 #include "ui/aura/test/aura_test_base.h" | |
11 #include "ui/aura/test/test_windows.h" | 10 #include "ui/aura/test/test_windows.h" |
12 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
13 #include "ui/wm/core/transient_window_observer.h" | 12 #include "ui/wm/core/transient_window_observer.h" |
14 #include "ui/wm/core/window_util.h" | 13 #include "ui/wm/core/window_util.h" |
15 #include "ui/wm/core/wm_state.h" | 14 #include "ui/wm/core/wm_state.h" |
| 15 #include "ui/wm/test/wm_test_base.h" |
16 | 16 |
17 using aura::Window; | 17 using aura::Window; |
18 | 18 |
19 using aura::test::ChildWindowIDsAsString; | 19 using aura::test::ChildWindowIDsAsString; |
20 using aura::test::CreateTestWindowWithId; | 20 using aura::test::CreateTestWindowWithId; |
21 | 21 |
22 namespace wm { | 22 namespace wm { |
23 | 23 |
24 class TestTransientWindowObserver : public TransientWindowObserver { | 24 class TestTransientWindowObserver : public TransientWindowObserver { |
25 public: | 25 public: |
(...skipping 16 matching lines...) Expand all Loading... |
42 remove_count_++; | 42 remove_count_++; |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 int add_count_; | 46 int add_count_; |
47 int remove_count_; | 47 int remove_count_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(TestTransientWindowObserver); | 49 DISALLOW_COPY_AND_ASSIGN(TestTransientWindowObserver); |
50 }; | 50 }; |
51 | 51 |
52 class TransientWindowManagerTest : public aura::test::AuraTestBase { | 52 class TransientWindowManagerTest : public WMTestBase { |
53 public: | 53 public: |
54 TransientWindowManagerTest() {} | 54 TransientWindowManagerTest() {} |
55 virtual ~TransientWindowManagerTest() {} | 55 virtual ~TransientWindowManagerTest() {} |
56 | 56 |
57 virtual void SetUp() OVERRIDE { | 57 virtual void SetUp() OVERRIDE { |
58 AuraTestBase::SetUp(); | 58 AuraTestBase::SetUp(); |
59 wm_state_.reset(new wm::WMState); | 59 wm_state_.reset(new wm::WMState); |
60 } | 60 } |
61 | 61 |
62 virtual void TearDown() OVERRIDE { | 62 virtual void TearDown() OVERRIDE { |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 EXPECT_EQ(0, test_observer.remove_count()); | 627 EXPECT_EQ(0, test_observer.remove_count()); |
628 | 628 |
629 RemoveTransientChild(parent.get(), w1.get()); | 629 RemoveTransientChild(parent.get(), w1.get()); |
630 EXPECT_EQ(1, test_observer.add_count()); | 630 EXPECT_EQ(1, test_observer.add_count()); |
631 EXPECT_EQ(1, test_observer.remove_count()); | 631 EXPECT_EQ(1, test_observer.remove_count()); |
632 | 632 |
633 TransientWindowManager::Get(parent.get())->RemoveObserver(&test_observer); | 633 TransientWindowManager::Get(parent.get())->RemoveObserver(&test_observer); |
634 } | 634 } |
635 | 635 |
636 } // namespace wm | 636 } // namespace wm |
OLD | NEW |