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/launcher/launcher_view.h" | 5 #include "ash/launcher/launcher_view.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/launcher/launcher_button.h" | 8 #include "ash/launcher/launcher_button.h" |
9 #include "ash/launcher/launcher_icon_observer.h" | 9 #include "ash/launcher/launcher_icon_observer.h" |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 observer()->Reset(); | 90 observer()->Reset(); |
91 | 91 |
92 widget->Show(); | 92 widget->Show(); |
93 widget->GetNativeWindow()->parent()->RemoveChild(widget->GetNativeWindow()); | 93 widget->GetNativeWindow()->parent()->RemoveChild(widget->GetNativeWindow()); |
94 EXPECT_EQ(1, observer()->count()); | 94 EXPECT_EQ(1, observer()->count()); |
95 observer()->Reset(); | 95 observer()->Reset(); |
96 } | 96 } |
97 | 97 |
98 TEST_F(LauncherViewIconObserverTest, BoundsChanged) { | 98 TEST_F(LauncherViewIconObserverTest, BoundsChanged) { |
99 Launcher* launcher = Shell::GetInstance()->launcher(); | 99 Launcher* launcher = Shell::GetInstance()->launcher(); |
100 int total_width = launcher->widget()->GetWindowScreenBounds().width(); | 100 gfx::Size launcher_size = launcher->widget()->GetWindowScreenBounds().size(); |
| 101 int total_width = launcher_size.width() / 2; |
101 ASSERT_GT(total_width, 0); | 102 ASSERT_GT(total_width, 0); |
102 launcher->SetStatusWidth(total_width / 2); | 103 launcher->SetStatusSize(gfx::Size(total_width, launcher_size.height())); |
103 EXPECT_EQ(1, observer()->count()); | 104 EXPECT_EQ(1, observer()->count()); |
104 observer()->Reset(); | 105 observer()->Reset(); |
105 } | 106 } |
106 | 107 |
107 //////////////////////////////////////////////////////////////////////////////// | 108 //////////////////////////////////////////////////////////////////////////////// |
108 // LauncherView tests. | 109 // LauncherView tests. |
109 | 110 |
110 class LauncherViewTest : public aura::test::AuraTestBase { | 111 class LauncherViewTest : public aura::test::AuraTestBase { |
111 public: | 112 public: |
112 LauncherViewTest() {} | 113 LauncherViewTest() {} |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // Verifies non-overflow buttons are visible. | 284 // Verifies non-overflow buttons are visible. |
284 for (int i = 0; i <= test_api_->GetLastVisibleIndex(); ++i) { | 285 for (int i = 0; i <= test_api_->GetLastVisibleIndex(); ++i) { |
285 internal::LauncherButton* button = test_api_->GetButton(i); | 286 internal::LauncherButton* button = test_api_->GetButton(i); |
286 EXPECT_TRUE(button->visible()) << "button index=" << i; | 287 EXPECT_TRUE(button->visible()) << "button index=" << i; |
287 EXPECT_EQ(1.0f, button->layer()->opacity()) << "button index=" << i; | 288 EXPECT_EQ(1.0f, button->layer()->opacity()) << "button index=" << i; |
288 } | 289 } |
289 } | 290 } |
290 | 291 |
291 } // namespace test | 292 } // namespace test |
292 } // namespace ash | 293 } // namespace ash |
OLD | NEW |