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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 // Make sure to have a browser window | 803 // Make sure to have a browser window |
804 chrome::NewTab(browser()); | 804 chrome::NewTab(browser()); |
805 | 805 |
806 // No overflow yet. | 806 // No overflow yet. |
807 EXPECT_FALSE(launcher_->IsShowingOverflowBubble()); | 807 EXPECT_FALSE(launcher_->IsShowingOverflowBubble()); |
808 | 808 |
809 ash::test::LauncherViewTestAPI test(launcher_->GetLauncherViewForTest()); | 809 ash::test::LauncherViewTestAPI test(launcher_->GetLauncherViewForTest()); |
810 | 810 |
811 int items_added = 0; | 811 int items_added = 0; |
812 while (!test.IsOverflowButtonVisible()) { | 812 while (!test.IsOverflowButtonVisible()) { |
813 std::string fake_app_id = StringPrintf("fake_app_%d", items_added); | 813 std::string fake_app_id = base::StringPrintf("fake_app_%d", items_added); |
814 PinFakeApp(fake_app_id); | 814 PinFakeApp(fake_app_id); |
815 | 815 |
816 ++items_added; | 816 ++items_added; |
817 ASSERT_LT(items_added, 10000); | 817 ASSERT_LT(items_added, 10000); |
818 } | 818 } |
819 | 819 |
820 // Now show overflow bubble. | 820 // Now show overflow bubble. |
821 test.ShowOverflowBubble(); | 821 test.ShowOverflowBubble(); |
822 EXPECT_TRUE(launcher_->IsShowingOverflowBubble()); | 822 EXPECT_TRUE(launcher_->IsShowingOverflowBubble()); |
823 | 823 |
824 // Unpin first pinned app and there should be no crash. | 824 // Unpin first pinned app and there should be no crash. |
825 ChromeLauncherController* controller = | 825 ChromeLauncherController* controller = |
826 static_cast<ChromeLauncherController*>(launcher_->delegate()); | 826 static_cast<ChromeLauncherController*>(launcher_->delegate()); |
827 controller->UnpinAppsWithID(std::string("fake_app_0")); | 827 controller->UnpinAppsWithID(std::string("fake_app_0")); |
828 } | 828 } |
OLD | NEW |