Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: chrome/browser/chromeos/mobile/mobile_activator_unittest.cc

Issue 1562593002: Fix potential crashes in NetworkHandler code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test
Patch Set: IsShuttingDown -> OnShuttingDown Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 base::StringValue(shill::kTypeCellular)); 115 base::StringValue(shill::kTypeCellular));
116 } 116 }
117 ~MobileActivatorTest() override {} 117 ~MobileActivatorTest() override {}
118 118
119 protected: 119 protected:
120 void SetUp() override { 120 void SetUp() override {
121 DBusThreadManager::Initialize(); 121 DBusThreadManager::Initialize();
122 NetworkHandler::Initialize(); 122 NetworkHandler::Initialize();
123 } 123 }
124 void TearDown() override { 124 void TearDown() override {
125 mobile_activator_.TerminateActivation();
125 NetworkHandler::Shutdown(); 126 NetworkHandler::Shutdown();
126 DBusThreadManager::Shutdown(); 127 DBusThreadManager::Shutdown();
127 } 128 }
128 129
129 void set_activator_state(const MobileActivator::PlanActivationState state) { 130 void set_activator_state(const MobileActivator::PlanActivationState state) {
130 mobile_activator_.set_state_for_test(state); 131 mobile_activator_.set_state_for_test(state);
131 } 132 }
132 void set_network_activation_type(const std::string& activation_type) { 133 void set_network_activation_type(const std::string& activation_type) {
133 cellular_network_.activation_type_ = activation_type; 134 cellular_network_.activation_type_ = activation_type;
134 } 135 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, 356 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING,
356 mobile_activator_.InvokePickNextState(&cellular_network_, 357 mobile_activator_.InvokePickNextState(&cellular_network_,
357 &error_description)); 358 &error_description));
358 set_activator_state(MobileActivator::PLAN_ACTIVATION_SHOWING_PAYMENT); 359 set_activator_state(MobileActivator::PLAN_ACTIVATION_SHOWING_PAYMENT);
359 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING, 360 EXPECT_EQ(MobileActivator::PLAN_ACTIVATION_RECONNECTING,
360 mobile_activator_.InvokePickNextState(&cellular_network_, 361 mobile_activator_.InvokePickNextState(&cellular_network_,
361 &error_description)); 362 &error_description));
362 } 363 }
363 364
364 } // namespace chromeos 365 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/network_screen.cc ('k') | chrome/browser/chromeos/proxy_config_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698