| 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_connection_handler.h" | 10 #include "chromeos/network/network_connection_handler.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 MobileActivatorTest() | 107 MobileActivatorTest() |
| 108 : cellular_network_(string(kTestServicePath)), | 108 : cellular_network_(string(kTestServicePath)), |
| 109 mobile_activator_(&cellular_network_) { | 109 mobile_activator_(&cellular_network_) { |
| 110 cellular_network_.PropertyChanged(shill::kTypeProperty, | 110 cellular_network_.PropertyChanged(shill::kTypeProperty, |
| 111 base::StringValue(shill::kTypeCellular)); | 111 base::StringValue(shill::kTypeCellular)); |
| 112 } | 112 } |
| 113 virtual ~MobileActivatorTest() {} | 113 virtual ~MobileActivatorTest() {} |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 virtual void SetUp() { | 116 virtual void SetUp() { |
| 117 DBusThreadManager::InitializeWithStub(); | 117 DBusThreadManager::Initialize(); |
| 118 NetworkHandler::Initialize(); | 118 NetworkHandler::Initialize(); |
| 119 } | 119 } |
| 120 virtual void TearDown() { | 120 virtual void TearDown() { |
| 121 NetworkHandler::Shutdown(); | 121 NetworkHandler::Shutdown(); |
| 122 DBusThreadManager::Shutdown(); | 122 DBusThreadManager::Shutdown(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void set_activator_state(const MobileActivator::PlanActivationState state) { | 125 void set_activator_state(const MobileActivator::PlanActivationState state) { |
| 126 mobile_activator_.set_state_for_test(state); | 126 mobile_activator_.set_state_for_test(state); |
| 127 } | 127 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, | 351 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, |
| 352 mobile_activator_.InvokePickNextState(&cellular_network_, | 352 mobile_activator_.InvokePickNextState(&cellular_network_, |
| 353 &error_description)); | 353 &error_description)); |
| 354 set_activator_state(MobileActivator::PLAN_ACTIVATION_SHOWING_PAYMENT); | 354 set_activator_state(MobileActivator::PLAN_ACTIVATION_SHOWING_PAYMENT); |
| 355 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, | 355 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, |
| 356 mobile_activator_.InvokePickNextState(&cellular_network_, | 356 mobile_activator_.InvokePickNextState(&cellular_network_, |
| 357 &error_description)); | 357 &error_description)); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace chromeos | 360 } // namespace chromeos |
| OLD | NEW |