Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: ash/launcher/launcher_unittest.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | ash/launcher/launcher_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | ash/launcher/launcher_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698