| 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/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 Loading... |
| 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 |
| OLD | NEW |