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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1125 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 1125 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
1126 EXPECT_FALSE(panel->IsDrawingAttention()); | 1126 EXPECT_FALSE(panel->IsDrawingAttention()); |
1127 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); | 1127 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); |
1128 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); | 1128 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); |
1129 | 1129 |
1130 panel->Close(); | 1130 panel->Close(); |
1131 panel2->Close(); | 1131 panel2->Close(); |
1132 panel3->Close(); | 1132 panel3->Close(); |
1133 } | 1133 } |
1134 | 1134 |
1135 // http://crbug.com/175760 | |
raymes
2013/02/12 18:55:41
Optional: Just add a quick comment that it's flaky
| |
1136 #if defined(OS_MAC) | |
1137 #define MAYBE_StopDrawingAttentionWhileMinimized \ | |
1138 DISABLED_StopDrawingAttentionWhileMinimized | |
1139 #else | |
1140 #define MAYBE_StopDrawingAttentionWhileMinimized \ | |
1141 StopDrawingAttentionWhileMinimized | |
1142 #endif | |
1135 // Verify that minimized state of a panel is correct after draw attention | 1143 // Verify that minimized state of a panel is correct after draw attention |
1136 // is stopped when there are other minimized panels. | 1144 // is stopped when there are other minimized panels. |
1137 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, StopDrawingAttentionWhileMinimized) { | 1145 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, |
1146 MAYBE_StopDrawingAttentionWhileMinimized) { | |
1138 Panel* panel1 = CreatePanel("panel1"); | 1147 Panel* panel1 = CreatePanel("panel1"); |
1139 Panel* panel2 = CreatePanel("panel2"); | 1148 Panel* panel2 = CreatePanel("panel2"); |
1140 | 1149 |
1141 panel1->Minimize(); | 1150 panel1->Minimize(); |
1142 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); | 1151 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); |
1143 panel2->Minimize(); | 1152 panel2->Minimize(); |
1144 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); | 1153 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); |
1145 | 1154 |
1146 // Verify panel returns to minimized state when no longer drawing attention. | 1155 // Verify panel returns to minimized state when no longer drawing attention. |
1147 panel1->FlashFrame(true); | 1156 panel1->FlashFrame(true); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1315 native_panel_testing->ReleaseMouseButtonTitlebar(); | 1324 native_panel_testing->ReleaseMouseButtonTitlebar(); |
1316 | 1325 |
1317 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 1326 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
1318 EXPECT_FALSE(panel->IsDrawingAttention()); | 1327 EXPECT_FALSE(panel->IsDrawingAttention()); |
1319 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); | 1328 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); |
1320 | 1329 |
1321 panel->Close(); | 1330 panel->Close(); |
1322 panel2->Close(); | 1331 panel2->Close(); |
1323 } | 1332 } |
1324 | 1333 |
1334 // http://crbug.com/175760 | |
1335 #if defined(OS_MAC) | |
1336 #define MAYBE_MinimizeImmediatelyAfterRestore \ | |
1337 DISABLED_MinimizeImmediatelyAfterRestore | |
1338 #else | |
1339 #define MAYBE_MinimizeImmediatelyAfterRestore MinimizeImmediatelyAfterRestore | |
1340 #endif | |
1325 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, | 1341 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, |
1326 MinimizeImmediatelyAfterRestore) { | 1342 MAYBE_MinimizeImmediatelyAfterRestore) { |
1327 CreatePanelParams params("Panel Test", gfx::Rect(), SHOW_AS_ACTIVE); | 1343 CreatePanelParams params("Panel Test", gfx::Rect(), SHOW_AS_ACTIVE); |
1328 Panel* panel = CreatePanelWithParams(params); | 1344 Panel* panel = CreatePanelWithParams(params); |
1329 scoped_ptr<NativePanelTesting> native_panel_testing( | 1345 scoped_ptr<NativePanelTesting> native_panel_testing( |
1330 CreateNativePanelTesting(panel)); | 1346 CreateNativePanelTesting(panel)); |
1331 | 1347 |
1332 PanelActiveStateObserver signal(panel, false); | 1348 PanelActiveStateObserver signal(panel, false); |
1333 panel->Minimize(); // this should deactivate. | 1349 panel->Minimize(); // this should deactivate. |
1334 signal.Wait(); | 1350 signal.Wait(); |
1335 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); | 1351 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); |
1336 | 1352 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1756 #else | 1772 #else |
1757 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize | 1773 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize |
1758 #endif | 1774 #endif |
1759 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, | 1775 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, |
1760 MAYBE_FocusChangeEventOnMinimize) { | 1776 MAYBE_FocusChangeEventOnMinimize) { |
1761 // This is needed so the subsequently created panels can be activated. | 1777 // This is needed so the subsequently created panels can be activated. |
1762 // On a Mac, it transforms background-only test process into foreground one. | 1778 // On a Mac, it transforms background-only test process into foreground one. |
1763 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 1779 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
1764 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; | 1780 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; |
1765 } | 1781 } |
OLD | NEW |