Chromium Code Reviews| 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 4a9dcc0fbae9e8e36d538e7191f1e1eff68cd268..f1b35e5b9a7e595822c4c14de20298fa75d61b93 100644 |
| --- a/ash/common/system/tray/system_tray_unittest.cc |
| +++ b/ash/common/system/tray/system_tray_unittest.cc |
| @@ -203,6 +203,16 @@ TEST_F(SystemTrayTest, SystemTrayDefaultView) { |
| ASSERT_FALSE(tray->CloseSystemBubble()); |
| } |
| +TEST_F(SystemTrayTest, Activation) { |
|
James Cook
2016/09/22 21:17:16
Document what this is testing and reference the bu
oshima
2016/09/23 09:37:20
Done.
|
| + SystemTray* tray = GetPrimarySystemTray(); |
| + |
| + tray->ShowDefaultView(BUBBLE_CREATE_NEW); |
| + ASSERT_TRUE(tray->GetWidget()); |
| + EXPECT_FALSE(tray->GetSystemBubble()->bubble_view()->GetWidget()->IsActive()); |
| + tray->ActivateBubble(); |
| + EXPECT_TRUE(tray->GetSystemBubble()->bubble_view()->GetWidget()->IsActive()); |
| +} |
| + |
| // Opening and closing the bubble should change the coloring of the tray. |
| TEST_F(SystemTrayTest, SystemTrayColoring) { |
| SystemTray* tray = GetPrimarySystemTray(); |
| @@ -445,6 +455,7 @@ TEST_F(SystemTrayTest, PersistentBubble) { |
| // Tests for usual default view while activating a window. |
| tray->ShowDefaultView(BUBBLE_CREATE_NEW); |
| + tray->ActivateBubble(); |
| ASSERT_TRUE(tray->HasSystemBubble()); |
| widget->Activate(); |
| base::RunLoop().RunUntilIdle(); |
| @@ -472,6 +483,20 @@ TEST_F(SystemTrayTest, PersistentBubble) { |
| generator.ClickLeftButton(); |
| ASSERT_TRUE(tray->HasSystemBubble()); |
| } |
| + |
| + // Same tests for persistent default view with activation. |
| + tray->ShowPersistentDefaultView(); |
| + ASSERT_TRUE(tray->HasSystemBubble()); |
|
James Cook
2016/09/22 21:17:17
These should all be EXPECT_TRUE (the old test code
oshima
2016/09/23 09:37:20
Yes, I noticed that. I tried to change them all, b
|
| + widget->Activate(); |
| + base::RunLoop().RunUntilIdle(); |
| + ASSERT_TRUE(tray->HasSystemBubble()); |
| + |
| + { |
|
James Cook
2016/09/22 21:17:17
no need for block scope here (or elsewhere in this
oshima
2016/09/23 09:37:20
Let me fix elsewhere in another CL.
|
| + ui::test::EventGenerator& generator = GetEventGenerator(); |
| + generator.set_current_location(gfx::Point(5, 5)); |
| + generator.ClickLeftButton(); |
| + ASSERT_TRUE(tray->HasSystemBubble()); |
| + } |
| } |
| #if defined(OS_CHROMEOS) |