OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/aura/mus/window_tree_host_mus.h" | 5 #include "ui/aura/mus/window_tree_host_mus.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/aura/mus/window_tree_host_mus_init_params.h" |
8 #include "ui/aura/test/aura_mus_test_base.h" | 9 #include "ui/aura/test/aura_mus_test_base.h" |
9 #include "ui/aura/test/mus/test_window_tree.h" | 10 #include "ui/aura/test/mus/test_window_tree.h" |
10 | 11 |
11 namespace aura { | 12 namespace aura { |
12 | 13 |
13 using WindowTreeHostMusTest = aura::test::AuraMusClientTestBase; | 14 using WindowTreeHostMusTest = aura::test::AuraMusClientTestBase; |
14 | 15 |
15 TEST_F(WindowTreeHostMusTest, UpdateClientArea) { | 16 TEST_F(WindowTreeHostMusTest, UpdateClientArea) { |
16 std::unique_ptr<WindowTreeHostMus> window_tree_host_mus = | 17 std::unique_ptr<WindowTreeHostMus> window_tree_host_mus = |
17 base::MakeUnique<WindowTreeHostMus>(window_tree_client_impl(), | 18 base::MakeUnique<WindowTreeHostMus>( |
18 cc::FrameSinkId()); | 19 aura::CreateInitParamsForTopLevel(window_tree_client_impl())); |
19 | 20 |
20 gfx::Insets new_insets(10, 11, 12, 13); | 21 gfx::Insets new_insets(10, 11, 12, 13); |
21 window_tree_host_mus->SetClientArea(new_insets, std::vector<gfx::Rect>()); | 22 window_tree_host_mus->SetClientArea(new_insets, std::vector<gfx::Rect>()); |
22 EXPECT_EQ(new_insets, window_tree()->last_client_area()); | 23 EXPECT_EQ(new_insets, window_tree()->last_client_area()); |
23 } | 24 } |
24 | 25 |
25 TEST_F(WindowTreeHostMusTest, SetHitTestMask) { | 26 TEST_F(WindowTreeHostMusTest, SetHitTestMask) { |
26 std::unique_ptr<WindowTreeHostMus> window_tree_host_mus = | 27 std::unique_ptr<WindowTreeHostMus> window_tree_host_mus = |
27 base::MakeUnique<WindowTreeHostMus>(window_tree_client_impl(), | 28 base::MakeUnique<WindowTreeHostMus>( |
28 cc::FrameSinkId()); | 29 CreateInitParamsForTopLevel(window_tree_client_impl())); |
29 | 30 |
30 EXPECT_FALSE(window_tree()->last_hit_test_mask().has_value()); | 31 EXPECT_FALSE(window_tree()->last_hit_test_mask().has_value()); |
31 gfx::Rect mask(10, 10, 10, 10); | 32 gfx::Rect mask(10, 10, 10, 10); |
32 window_tree_host_mus->SetHitTestMask(mask); | 33 window_tree_host_mus->SetHitTestMask(mask); |
33 ASSERT_TRUE(window_tree()->last_hit_test_mask().has_value()); | 34 ASSERT_TRUE(window_tree()->last_hit_test_mask().has_value()); |
34 EXPECT_EQ(mask, window_tree()->last_hit_test_mask()); | 35 EXPECT_EQ(mask, window_tree()->last_hit_test_mask()); |
35 | 36 |
36 window_tree_host_mus->SetHitTestMask(base::nullopt); | 37 window_tree_host_mus->SetHitTestMask(base::nullopt); |
37 ASSERT_FALSE(window_tree()->last_hit_test_mask().has_value()); | 38 ASSERT_FALSE(window_tree()->last_hit_test_mask().has_value()); |
38 } | 39 } |
39 | 40 |
40 } // namespace aura | 41 } // namespace aura |
OLD | NEW |