OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ime_util_chromeos.h" | 5 #include "ui/wm/core/ime_util_chromeos.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
10 #include "ui/aura/test/test_windows.h" | 10 #include "ui/aura/test/test_windows.h" |
11 #include "ui/base/ui_base_switches.h" | 11 #include "ui/base/ui_base_switches.h" |
12 #include "ui/wm/core/default_screen_position_client.h" | 12 #include "ui/wm/core/default_screen_position_client.h" |
13 | 13 |
14 namespace wm { | 14 namespace wm { |
15 | 15 |
16 class ImeUtilChromeosTest : public aura::test::AuraTestBase { | 16 class ImeUtilChromeosTest : public aura::test::AuraTestBase { |
17 public: | 17 public: |
18 ImeUtilChromeosTest() = default; | 18 ImeUtilChromeosTest() = default; |
19 ~ImeUtilChromeosTest() override = default; | 19 ~ImeUtilChromeosTest() override = default; |
20 | 20 |
21 void SetUp() override { | 21 void SetUp() override { |
22 AuraTestBase::SetUp(); | 22 AuraTestBase::SetUp(); |
23 screen_position_client_ = base::MakeUnique<DefaultScreenPositionClient>(); | 23 screen_position_client_ = base::MakeUnique<DefaultScreenPositionClient>(); |
24 aura::client::SetScreenPositionClient(root_window(), | 24 aura::client::SetScreenPositionClient(root_window(), |
25 screen_position_client_.get()); | 25 screen_position_client_.get()); |
26 | |
27 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
28 if (!command_line->HasSwitch(::switches::kUseNewVirtualKeyboardBehavior)) | |
29 command_line->AppendSwitch(::switches::kUseNewVirtualKeyboardBehavior); | |
30 } | 26 } |
31 | 27 |
32 void TearDown() override { | 28 void TearDown() override { |
33 aura::client::SetScreenPositionClient(root_window(), nullptr); | 29 aura::client::SetScreenPositionClient(root_window(), nullptr); |
34 AuraTestBase::TearDown(); | 30 AuraTestBase::TearDown(); |
35 } | 31 } |
36 | 32 |
37 private: | 33 private: |
38 std::unique_ptr<aura::client::ScreenPositionClient> screen_position_client_; | 34 std::unique_ptr<aura::client::ScreenPositionClient> screen_position_client_; |
39 | 35 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Now the rect doesn't overlap the original window bounds. The original | 130 // Now the rect doesn't overlap the original window bounds. The original |
135 // window bounds should be restored. | 131 // window bounds should be restored. |
136 rect = gfx::Rect(200, 200, 200, 200); | 132 rect = gfx::Rect(200, 200, 200, 200); |
137 EXPECT_TRUE(gfx::IntersectRects(rect, original_bounds).IsEmpty()); | 133 EXPECT_TRUE(gfx::IntersectRects(rect, original_bounds).IsEmpty()); |
138 EnsureWindowNotInRect(window, rect); | 134 EnsureWindowNotInRect(window, rect); |
139 EXPECT_EQ(original_bounds, window->bounds()); | 135 EXPECT_EQ(original_bounds, window->bounds()); |
140 EXPECT_EQ(original_bounds, window->GetBoundsInScreen()); | 136 EXPECT_EQ(original_bounds, window->GetBoundsInScreen()); |
141 } | 137 } |
142 | 138 |
143 } // namespace wm | 139 } // namespace wm |
OLD | NEW |