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

Side by Side Diff: ash/system/tray/system_tray_unittest.cc

Issue 12260046: Show notification when activating with no connection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix logic and type icon Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698