| 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.h" | 5 #include "ash/launcher/launcher.h" |
| 6 #include "ash/launcher/launcher_button.h" | 6 #include "ash/launcher/launcher_button.h" |
| 7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
| 8 #include "ash/launcher/launcher_view.h" | 8 #include "ash/launcher/launcher_view.h" |
| 9 | 9 |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 int button_count = test.GetButtonCount(); | 68 int button_count = test.GetButtonCount(); |
| 69 | 69 |
| 70 // Add running tab. | 70 // Add running tab. |
| 71 LauncherItem item; | 71 LauncherItem item; |
| 72 item.type = TYPE_TABBED; | 72 item.type = TYPE_TABBED; |
| 73 item.status = STATUS_RUNNING; | 73 item.status = STATUS_RUNNING; |
| 74 int index = model->Add(item); | 74 int index = model->Add(item); |
| 75 ASSERT_EQ(++button_count, test.GetButtonCount()); | 75 ASSERT_EQ(++button_count, test.GetButtonCount()); |
| 76 LauncherButton* button = test.GetButton(index); | 76 LauncherButton* button = test.GetButton(index); |
| 77 button->AddState(LauncherButton::STATE_HOVERED); | 77 button->AddState(LauncherButton::STATE_HOVERED); |
| 78 button->ShowContextMenu(gfx::Point(), true); | 78 button->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); |
| 79 EXPECT_FALSE(button->state() & LauncherButton::STATE_HOVERED); | 79 EXPECT_FALSE(button->state() & LauncherButton::STATE_HOVERED); |
| 80 | 80 |
| 81 // Remove it. | 81 // Remove it. |
| 82 model->RemoveItemAt(index); | 82 model->RemoveItemAt(index); |
| 83 } | 83 } |
| 84 | 84 |
| 85 TEST_F(LauncherTest, ShowOverflowBubble) { | 85 TEST_F(LauncherTest, ShowOverflowBubble) { |
| 86 Launcher* launcher = Launcher::ForPrimaryDisplay(); | 86 Launcher* launcher = Launcher::ForPrimaryDisplay(); |
| 87 ASSERT_TRUE(launcher); | 87 ASSERT_TRUE(launcher); |
| 88 | 88 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 110 | 110 |
| 111 // Removes the first item in main launcher view. | 111 // Removes the first item in main launcher view. |
| 112 model->RemoveItemAt(model->ItemIndexByID(first_item_id)); | 112 model->RemoveItemAt(model->ItemIndexByID(first_item_id)); |
| 113 | 113 |
| 114 // Waits for all transitions to finish and there should be no crash. | 114 // Waits for all transitions to finish and there should be no crash. |
| 115 test.RunMessageLoopUntilAnimationsDone(); | 115 test.RunMessageLoopUntilAnimationsDone(); |
| 116 EXPECT_FALSE(launcher->IsShowingOverflowBubble()); | 116 EXPECT_FALSE(launcher->IsShowingOverflowBubble()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace ash | 119 } // namespace ash |
| OLD | NEW |