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

Side by Side Diff: ash/system/chromeos/network/network_state_notifier_unittest.cc

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + elim LoginState dependency Created 7 years, 7 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
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/chromeos/network/network_state_notifier.h" 5 #include "ash/system/chromeos/network/network_state_notifier.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_widget.h" 8 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifierTest); 89 DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifierTest);
90 }; 90 };
91 91
92 TEST_F(NetworkStateNotifierTest, ConnectionFailure) { 92 TEST_F(NetworkStateNotifierTest, ConnectionFailure) {
93 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble()); 93 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble());
94 // State -> Failure for non connecting network should not spawn a notification 94 // State -> Failure for non connecting network should not spawn a notification
95 SetServiceState("wifi1", flimflam::kStateFailure); 95 SetServiceState("wifi1", flimflam::kStateFailure);
96 EXPECT_FALSE(GetSystemTray()->CloseNotificationBubbleForTest()); 96 EXPECT_FALSE(GetSystemTray()->CloseNotificationBubbleForTest());
97 // State -> Failure for connecting network should spawn a notification 97 // State -> Failure for connecting network should spawn a notification
98 SetServiceState("wifi1", flimflam::kStateAssociation); 98 SetServiceState("wifi1", flimflam::kStateAssociation);
99 NetworkStateHandler::Get()->SetConnectingNetwork("wifi1"); 99 NetworkHandler::Get()->network_state_handler()->SetConnectingNetwork("wifi1");
100 SetServiceState("wifi1", flimflam::kStateFailure); 100 SetServiceState("wifi1", flimflam::kStateFailure);
101 EXPECT_TRUE(GetSystemTray()->CloseNotificationBubbleForTest()); 101 EXPECT_TRUE(GetSystemTray()->CloseNotificationBubbleForTest());
102 // Failure -> Idle should not spawn a notification 102 // Failure -> Idle should not spawn a notification
103 SetServiceState("wifi1", flimflam::kStateIdle); 103 SetServiceState("wifi1", flimflam::kStateIdle);
104 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble()); 104 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble());
105 // Idle -> Failure should also not spawn a notification 105 // Idle -> Failure should also not spawn a notification
106 SetServiceState("wifi1", flimflam::kStateFailure); 106 SetServiceState("wifi1", flimflam::kStateFailure);
107 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble()); 107 EXPECT_FALSE(GetSystemTray()->HasNotificationBubble());
108 } 108 }
109 109
110 } // namespace test 110 } // namespace test
111 } // namespace ash 111 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698