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/wm/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace ash { | 42 namespace ash { |
43 | 43 |
44 using aura::test::WindowIsAbove; | 44 using aura::test::WindowIsAbove; |
45 | 45 |
46 class PanelLayoutManagerTest : public test::AshTestBase { | 46 class PanelLayoutManagerTest : public test::AshTestBase { |
47 public: | 47 public: |
48 PanelLayoutManagerTest() {} | 48 PanelLayoutManagerTest() {} |
49 virtual ~PanelLayoutManagerTest() {} | 49 virtual ~PanelLayoutManagerTest() {} |
50 | 50 |
51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() override { |
52 test::AshTestBase::SetUp(); | 52 test::AshTestBase::SetUp(); |
53 ASSERT_TRUE(test::TestShelfDelegate::instance()); | 53 ASSERT_TRUE(test::TestShelfDelegate::instance()); |
54 | 54 |
55 shelf_view_test_.reset(new test::ShelfViewTestAPI( | 55 shelf_view_test_.reset(new test::ShelfViewTestAPI( |
56 GetShelfView(Shelf::ForPrimaryDisplay()))); | 56 GetShelfView(Shelf::ForPrimaryDisplay()))); |
57 shelf_view_test_->SetAnimationDuration(1); | 57 shelf_view_test_->SetAnimationDuration(1); |
58 } | 58 } |
59 | 59 |
60 aura::Window* CreateNormalWindow(const gfx::Rect& bounds) { | 60 aura::Window* CreateNormalWindow(const gfx::Rect& bounds) { |
61 return CreateTestWindowInShellWithBounds(bounds); | 61 return CreateTestWindowInShellWithBounds(bounds); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManagerTest); | 271 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManagerTest); |
272 }; | 272 }; |
273 | 273 |
274 class PanelLayoutManagerTextDirectionTest | 274 class PanelLayoutManagerTextDirectionTest |
275 : public PanelLayoutManagerTest, | 275 : public PanelLayoutManagerTest, |
276 public testing::WithParamInterface<bool> { | 276 public testing::WithParamInterface<bool> { |
277 public: | 277 public: |
278 PanelLayoutManagerTextDirectionTest() : is_rtl_(GetParam()) {} | 278 PanelLayoutManagerTextDirectionTest() : is_rtl_(GetParam()) {} |
279 virtual ~PanelLayoutManagerTextDirectionTest() {} | 279 virtual ~PanelLayoutManagerTextDirectionTest() {} |
280 | 280 |
281 virtual void SetUp() OVERRIDE { | 281 virtual void SetUp() override { |
282 original_locale = l10n_util::GetApplicationLocale(std::string()); | 282 original_locale = l10n_util::GetApplicationLocale(std::string()); |
283 if (is_rtl_) | 283 if (is_rtl_) |
284 base::i18n::SetICUDefaultLocale("he"); | 284 base::i18n::SetICUDefaultLocale("he"); |
285 PanelLayoutManagerTest::SetUp(); | 285 PanelLayoutManagerTest::SetUp(); |
286 ASSERT_EQ(is_rtl_, base::i18n::IsRTL()); | 286 ASSERT_EQ(is_rtl_, base::i18n::IsRTL()); |
287 } | 287 } |
288 | 288 |
289 virtual void TearDown() OVERRIDE { | 289 virtual void TearDown() override { |
290 if (is_rtl_) | 290 if (is_rtl_) |
291 base::i18n::SetICUDefaultLocale(original_locale); | 291 base::i18n::SetICUDefaultLocale(original_locale); |
292 PanelLayoutManagerTest::TearDown(); | 292 PanelLayoutManagerTest::TearDown(); |
293 } | 293 } |
294 | 294 |
295 private: | 295 private: |
296 bool is_rtl_; | 296 bool is_rtl_; |
297 std::string original_locale; | 297 std::string original_locale; |
298 | 298 |
299 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManagerTextDirectionTest); | 299 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManagerTextDirectionTest); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 // Hit test outside the top edge with a top-aligned shelf. | 850 // Hit test outside the top edge with a top-aligned shelf. |
851 touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6)); | 851 touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6)); |
852 target = targeter->FindTargetForEvent(root, &touch); | 852 target = targeter->FindTargetForEvent(root, &touch); |
853 EXPECT_NE(w.get(), target); | 853 EXPECT_NE(w.get(), target); |
854 } | 854 } |
855 | 855 |
856 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, | 856 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, |
857 testing::Bool()); | 857 testing::Bool()); |
858 | 858 |
859 } // namespace ash | 859 } // namespace ash |
OLD | NEW |