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 "chrome/browser/chromeos/mobile/mobile_activator.h" | 5 #include "chrome/browser/chromeos/mobile/mobile_activator.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chromeos/network/network_handler.h" | 10 #include "chromeos/network/network_handler.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 DBusThreadManager::Shutdown(); | 94 DBusThreadManager::Shutdown(); |
95 } | 95 } |
96 | 96 |
97 void set_activator_state(const MobileActivator::PlanActivationState state) { | 97 void set_activator_state(const MobileActivator::PlanActivationState state) { |
98 mobile_activator_.state_ = state; | 98 mobile_activator_.state_ = state; |
99 } | 99 } |
100 void set_network_activation_state(const std::string& activation_state) { | 100 void set_network_activation_state(const std::string& activation_state) { |
101 cellular_network_.activation_state_ = activation_state; | 101 cellular_network_.activation_state_ = activation_state; |
102 } | 102 } |
103 void set_connection_state(const std::string& state) { | 103 void set_connection_state(const std::string& state) { |
| 104 cellular_network_.visible_ = true; |
104 cellular_network_.connection_state_ = state; | 105 cellular_network_.connection_state_ = state; |
105 } | 106 } |
106 | 107 |
107 base::MessageLoop message_loop_; | 108 base::MessageLoop message_loop_; |
108 NetworkState cellular_network_; | 109 NetworkState cellular_network_; |
109 TestMobileActivator mobile_activator_; | 110 TestMobileActivator mobile_activator_; |
110 private: | 111 private: |
111 DISALLOW_COPY_AND_ASSIGN(MobileActivatorTest); | 112 DISALLOW_COPY_AND_ASSIGN(MobileActivatorTest); |
112 }; | 113 }; |
113 | 114 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 TEST_F(MobileActivatorTest, StartAtStart) { | 266 TEST_F(MobileActivatorTest, StartAtStart) { |
266 EXPECT_CALL(mobile_activator_, HasRecentCellularPlanPayment()) | 267 EXPECT_CALL(mobile_activator_, HasRecentCellularPlanPayment()) |
267 .WillOnce(Return(false)); | 268 .WillOnce(Return(false)); |
268 EXPECT_CALL(mobile_activator_, | 269 EXPECT_CALL(mobile_activator_, |
269 EvaluateCellularNetwork(Eq(&cellular_network_))); | 270 EvaluateCellularNetwork(Eq(&cellular_network_))); |
270 mobile_activator_.StartActivation(); | 271 mobile_activator_.StartActivation(); |
271 EXPECT_EQ(mobile_activator_.state(), MobileActivator::PLAN_ACTIVATION_START); | 272 EXPECT_EQ(mobile_activator_.state(), MobileActivator::PLAN_ACTIVATION_START); |
272 } | 273 } |
273 | 274 |
274 } // namespace chromeos | 275 } // namespace chromeos |
OLD | NEW |