OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "chrome/browser/chromeos/status/data_promo_notification.h" | 5 #include "chrome/browser/chromeos/status/data_promo_notification.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Create a cellular network and activate it. | 128 // Create a cellular network and activate it. |
129 ShillServiceClient::TestInterface* service_test = | 129 ShillServiceClient::TestInterface* service_test = |
130 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); | 130 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); |
131 service_test->ClearServices(); | 131 service_test->ClearServices(); |
132 service_test->AddService(kCellularServicePath, kCellularGuid, | 132 service_test->AddService(kCellularServicePath, kCellularGuid, |
133 "cellular1" /* name */, shill::kTypeCellular, | 133 "cellular1" /* name */, shill::kTypeCellular, |
134 "activated", true /* visible */); | 134 "activated", true /* visible */); |
135 service_test->SetServiceProperty( | 135 service_test->SetServiceProperty( |
136 kCellularServicePath, shill::kActivationStateProperty, | 136 kCellularServicePath, shill::kActivationStateProperty, |
137 base::StringValue(shill::kActivationStateActivated)); | 137 base::Value(shill::kActivationStateActivated)); |
138 service_test->SetServiceProperty( | 138 service_test->SetServiceProperty( |
139 kCellularServicePath, shill::kConnectableProperty, base::Value(true)); | 139 kCellularServicePath, shill::kConnectableProperty, base::Value(true)); |
140 } | 140 } |
141 | 141 |
142 content::TestBrowserThreadBundle thread_bundle_; | 142 content::TestBrowserThreadBundle thread_bundle_; |
143 std::unique_ptr<DataPromoNotification> data_promo_notification_; | 143 std::unique_ptr<DataPromoNotification> data_promo_notification_; |
144 std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_; | 144 std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_; |
145 std::unique_ptr<ScopedUserManagerEnabler> user_manager_enabler_; | 145 std::unique_ptr<ScopedUserManagerEnabler> user_manager_enabler_; |
146 std::unique_ptr<TestingProfileManager> profile_manager_; | 146 std::unique_ptr<TestingProfileManager> profile_manager_; |
147 | 147 |
(...skipping 10 matching lines...) Expand all Loading... |
158 | 158 |
159 chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); | 159 chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); |
160 base::RunLoop().RunUntilIdle(); | 160 base::RunLoop().RunUntilIdle(); |
161 // Connecting to cellular network (which here makes it the default network) | 161 // Connecting to cellular network (which here makes it the default network) |
162 // should trigger the Data Saver notification. | 162 // should trigger the Data Saver notification. |
163 EXPECT_TRUE(message_center->FindVisibleNotificationById(kNotificationId)); | 163 EXPECT_TRUE(message_center->FindVisibleNotificationById(kNotificationId)); |
164 } | 164 } |
165 | 165 |
166 } // namespace test | 166 } // namespace test |
167 } // namespace chromeos | 167 } // namespace chromeos |
OLD | NEW |