| 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 "ash/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 tray->AddTrayItem(detailed_item); | 225 tray->AddTrayItem(detailed_item); |
| 226 | 226 |
| 227 // Ensure the tray views are created. | 227 // Ensure the tray views are created. |
| 228 ASSERT_TRUE(test_item->tray_view() != NULL); | 228 ASSERT_TRUE(test_item->tray_view() != NULL); |
| 229 ASSERT_TRUE(detailed_item->tray_view() != NULL); | 229 ASSERT_TRUE(detailed_item->tray_view() != NULL); |
| 230 | 230 |
| 231 // Ensure a notification view is created. | 231 // Ensure a notification view is created. |
| 232 tray->ShowNotificationView(test_item); | 232 tray->ShowNotificationView(test_item); |
| 233 ASSERT_TRUE(test_item->notification_view() != NULL); | 233 ASSERT_TRUE(test_item->notification_view() != NULL); |
| 234 | 234 |
| 235 // Show the default view, ensure the notification view is destroyed. | 235 // Show the default view, notification view should remain. |
| 236 tray->ShowDefaultView(BUBBLE_CREATE_NEW); | 236 tray->ShowDefaultView(BUBBLE_CREATE_NEW); |
| 237 RunAllPendingInMessageLoop(); | 237 RunAllPendingInMessageLoop(); |
| 238 ASSERT_TRUE(test_item->notification_view() == NULL); | 238 ASSERT_TRUE(test_item->notification_view() != NULL); |
| 239 | 239 |
| 240 // Show the detailed view, ensure the notificaiton view is created again. | 240 // Show the detailed view, ensure the notificaiton view remains. |
| 241 tray->ShowDetailedView(detailed_item, 0, false, BUBBLE_CREATE_NEW); | 241 tray->ShowDetailedView(detailed_item, 0, false, BUBBLE_CREATE_NEW); |
| 242 RunAllPendingInMessageLoop(); | 242 RunAllPendingInMessageLoop(); |
| 243 ASSERT_TRUE(detailed_item->detailed_view() != NULL); | 243 ASSERT_TRUE(detailed_item->detailed_view() != NULL); |
| 244 ASSERT_TRUE(test_item->notification_view() != NULL); | 244 ASSERT_TRUE(test_item->notification_view() != NULL); |
| 245 | 245 |
| 246 // Hide the detailed view, ensure the notificaiton view still exists. | 246 // Hide the detailed view, ensure the notificaiton view still exists. |
| 247 ASSERT_TRUE(tray->CloseBubbleForTest()); | 247 ASSERT_TRUE(tray->CloseBubbleForTest()); |
| 248 RunAllPendingInMessageLoop(); | 248 RunAllPendingInMessageLoop(); |
| 249 ASSERT_TRUE(detailed_item->detailed_view() == NULL); | 249 ASSERT_TRUE(detailed_item->detailed_view() == NULL); |
| 250 ASSERT_TRUE(test_item->notification_view() != NULL); | 250 ASSERT_TRUE(test_item->notification_view() != NULL); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 279 tray->ShowDefaultView(BUBBLE_USE_EXISTING); | 279 tray->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 280 RunAllPendingInMessageLoop(); | 280 RunAllPendingInMessageLoop(); |
| 281 | 281 |
| 282 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> | 282 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> |
| 283 GetWindowBoundsInScreen().ToString()); | 283 GetWindowBoundsInScreen().ToString()); |
| 284 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); | 284 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace test | 287 } // namespace test |
| 288 } // namespace ash | 288 } // namespace ash |
| OLD | NEW |