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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "chrome/browser/ui/panels/base_panel_browser_test.h" | 6 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
7 #include "chrome/browser/ui/panels/detached_panel_collection.h" | 7 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
8 #include "chrome/browser/ui/panels/native_panel.h" | 8 #include "chrome/browser/ui/panels/native_panel.h" |
9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
10 #include "chrome/browser/ui/panels/panel_manager.h" | 10 #include "chrome/browser/ui/panels/panel_manager.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 CreateInactiveDetachedPanel("1", gfx::Rect(300, 200, 250, 200)); | 105 CreateInactiveDetachedPanel("1", gfx::Rect(300, 200, 250, 200)); |
106 scoped_ptr<NativePanelTesting> native_panel_testing( | 106 scoped_ptr<NativePanelTesting> native_panel_testing( |
107 CreateNativePanelTesting(panel)); | 107 CreateNativePanelTesting(panel)); |
108 | 108 |
109 // Test that the attention is drawn when the detached panel is not in focus. | 109 // Test that the attention is drawn when the detached panel is not in focus. |
110 panel->FlashFrame(true); | 110 panel->FlashFrame(true); |
111 EXPECT_TRUE(panel->IsDrawingAttention()); | 111 EXPECT_TRUE(panel->IsDrawingAttention()); |
112 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); | 112 EXPECT_TRUE(native_panel_testing->VerifyDrawingAttention()); |
113 | 113 |
114 // Test that the attention is cleared when panel gets focus. | 114 // Test that the attention is cleared when panel gets focus. |
115 panel->Activate(); | 115 panel->Activate(false /* user_gesture */); |
116 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 116 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
117 EXPECT_FALSE(panel->IsDrawingAttention()); | 117 EXPECT_FALSE(panel->IsDrawingAttention()); |
118 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); | 118 EXPECT_FALSE(native_panel_testing->VerifyDrawingAttention()); |
119 | 119 |
120 PanelManager::GetInstance()->CloseAll(); | 120 PanelManager::GetInstance()->CloseAll(); |
121 } | 121 } |
122 | 122 |
123 IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, ClickTitlebar) { | 123 IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, ClickTitlebar) { |
124 Panel* panel = CreateDetachedPanel("1", gfx::Rect(300, 200, 250, 200)); | 124 Panel* panel = CreateDetachedPanel("1", gfx::Rect(300, 200, 250, 200)); |
125 EXPECT_FALSE(panel->IsMinimized()); | 125 EXPECT_FALSE(panel->IsMinimized()); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 // Panel should not be shown on full-screen mode. | 248 // Panel should not be shown on full-screen mode. |
249 EXPECT_FALSE(panel_testing->IsWindowVisible()); | 249 EXPECT_FALSE(panel_testing->IsWindowVisible()); |
250 | 250 |
251 // Panel should become visible when leaving full-screen mode. | 251 // Panel should become visible when leaving full-screen mode. |
252 mock_display_settings_provider()->EnableFullScreenMode(false); | 252 mock_display_settings_provider()->EnableFullScreenMode(false); |
253 EXPECT_TRUE(panel_testing->IsWindowVisible()); | 253 EXPECT_TRUE(panel_testing->IsWindowVisible()); |
254 | 254 |
255 PanelManager::GetInstance()->CloseAll(); | 255 PanelManager::GetInstance()->CloseAll(); |
256 } | 256 } |
OLD | NEW |