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

Unified Diff: ash/common/system/tray/system_tray_unittest.cc

Issue 2752643002: chromeos: Enable Alt-Shift-S to show system tray bubble for mash (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/tray/system_tray_unittest.cc
diff --git a/ash/common/system/tray/system_tray_unittest.cc b/ash/common/system/tray/system_tray_unittest.cc
index ba66ce6595b9ea7420931b35c8f7955e8d343c64..90b6832400ca29ffa5373b05eeb60c39e45d38f0 100644
--- a/ash/common/system/tray/system_tray_unittest.cc
+++ b/ash/common/system/tray/system_tray_unittest.cc
@@ -205,30 +205,31 @@ TEST_F(SystemTrayTest, SystemTrayDefaultView) {
// Make sure the opening system tray bubble will not deactivate the
// other window. crbug.com/120680.
TEST_F(SystemTrayTest, Activation) {
- // TODO: investigate why this fails in mash. http://crbug.com/695559.
- if (WmShell::Get()->IsRunningInMash())
- return;
-
SystemTray* tray = GetPrimarySystemTray();
std::unique_ptr<views::Widget> widget(CreateTestWidget(
nullptr, kShellWindowId_DefaultContainer, gfx::Rect(0, 0, 100, 100)));
EXPECT_TRUE(widget->IsActive());
+ // The window stays active after the bubble opens.
tray->ShowDefaultView(BUBBLE_CREATE_NEW);
ASSERT_TRUE(tray->GetWidget());
EXPECT_FALSE(tray->GetSystemBubble()->bubble_view()->GetWidget()->IsActive());
EXPECT_TRUE(widget->IsActive());
+ // Activating the bubble makes the window lose activation.
tray->ActivateBubble();
EXPECT_TRUE(tray->GetSystemBubble()->bubble_view()->GetWidget()->IsActive());
EXPECT_FALSE(widget->IsActive());
- // Accelerator will activate the bubble.
+ // Closing the bubble re-activates the window.
msw 2017/03/14 17:25:23 aside: Activation changes in unit tests can be fla
James Cook 2017/03/14 17:46:30 Acknowledged. I think each test gets its own ash::
tray->CloseSystemBubble();
-
EXPECT_TRUE(widget->IsActive());
+
+ // Opening the bubble with an accelerator activates the bubble because the
+ // user will probably navigate with the keyboard.
WmShell::Get()->accelerator_controller()->PerformActionIfEnabled(
SHOW_SYSTEM_TRAY_BUBBLE);
+ ASSERT_TRUE(tray->GetWidget());
EXPECT_TRUE(tray->GetSystemBubble()->bubble_view()->GetWidget()->IsActive());
EXPECT_FALSE(widget->IsActive());
}
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/mus/accelerators/accelerator_controller_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698