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 "ui/chromeos/network/network_state_notifier.h" | 5 #include "ui/chromeos/network/network_state_notifier.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chromeos/dbus/shill_device_client.h" | 10 #include "chromeos/dbus/shill_device_client.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 add_to_visible); | 90 add_to_visible); |
91 service_test->SetServiceProperty("wifi1", shill::kSecurityClassProperty, | 91 service_test->SetServiceProperty("wifi1", shill::kSecurityClassProperty, |
92 base::StringValue(shill::kSecurityWep)); | 92 base::StringValue(shill::kSecurityWep)); |
93 service_test->SetServiceProperty("wifi1", shill::kConnectableProperty, | 93 service_test->SetServiceProperty("wifi1", shill::kConnectableProperty, |
94 base::FundamentalValue(true)); | 94 base::FundamentalValue(true)); |
95 service_test->SetServiceProperty("wifi1", shill::kPassphraseProperty, | 95 service_test->SetServiceProperty("wifi1", shill::kPassphraseProperty, |
96 base::StringValue("failure")); | 96 base::StringValue("failure")); |
97 base::RunLoop().RunUntilIdle(); | 97 base::RunLoop().RunUntilIdle(); |
98 } | 98 } |
99 | 99 |
100 scoped_ptr<NetworkConnectTestDelegate> network_connect_delegate_; | 100 std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_; |
101 base::MessageLoop message_loop_; | 101 base::MessageLoop message_loop_; |
102 | 102 |
103 private: | 103 private: |
104 DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifierTest); | 104 DISALLOW_COPY_AND_ASSIGN(NetworkStateNotifierTest); |
105 }; | 105 }; |
106 | 106 |
107 TEST_F(NetworkStateNotifierTest, ConnectionFailure) { | 107 TEST_F(NetworkStateNotifierTest, ConnectionFailure) { |
108 NetworkConnect::Get()->ConnectToNetwork("wifi1"); | 108 NetworkConnect::Get()->ConnectToNetwork("wifi1"); |
109 base::RunLoop().RunUntilIdle(); | 109 base::RunLoop().RunUntilIdle(); |
110 // Failure should spawn a notification. | 110 // Failure should spawn a notification. |
111 message_center::MessageCenter* message_center = | 111 message_center::MessageCenter* message_center = |
112 message_center::MessageCenter::Get(); | 112 message_center::MessageCenter::Get(); |
113 EXPECT_TRUE(message_center->FindVisibleNotificationById( | 113 EXPECT_TRUE(message_center->FindVisibleNotificationById( |
114 NetworkStateNotifier::kNetworkConnectNotificationId)); | 114 NetworkStateNotifier::kNetworkConnectNotificationId)); |
115 } | 115 } |
116 | 116 |
117 } // namespace test | 117 } // namespace test |
118 } // namespace ui | 118 } // namespace ui |
OLD | NEW |