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

Side by Side Diff: chrome/browser/chromeos/net/network_throttling_observer_unittest.cc

Issue 2689223002: Defer NetworkConfigurationHandler::CreateShillConfiguration callback (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | chromeos/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/chromeos/net/network_throttling_observer.h" 9 #include "chrome/browser/chromeos/net/network_throttling_observer.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 24 matching lines...) Expand all
35 std::unique_ptr<ShillManagerClient>(mock_manager_client_)); 35 std::unique_ptr<ShillManagerClient>(mock_manager_client_));
36 network_state_handler_ = NetworkStateHandler::InitializeForTest(); 36 network_state_handler_ = NetworkStateHandler::InitializeForTest();
37 NetworkHandler::Initialize(); 37 NetworkHandler::Initialize();
38 local_state_ = base::MakeUnique<TestingPrefServiceSimple>(); 38 local_state_ = base::MakeUnique<TestingPrefServiceSimple>();
39 local_state_->registry()->RegisterDictionaryPref( 39 local_state_->registry()->RegisterDictionaryPref(
40 prefs::kNetworkThrottlingEnabled); 40 prefs::kNetworkThrottlingEnabled);
41 observer_ = base::MakeUnique<NetworkThrottlingObserver>(local_state_.get()); 41 observer_ = base::MakeUnique<NetworkThrottlingObserver>(local_state_.get());
42 } 42 }
43 43
44 ~NetworkThrottlingObserverTest() override { 44 ~NetworkThrottlingObserverTest() override {
45 network_state_handler_->Shutdown();
45 observer_.reset(); 46 observer_.reset();
46 local_state_.reset(); 47 local_state_.reset();
47 network_state_handler_.reset(); 48 network_state_handler_.reset();
48 NetworkHandler::Shutdown(); 49 NetworkHandler::Shutdown();
49 DBusThreadManager::Shutdown(); 50 DBusThreadManager::Shutdown();
50 } 51 }
51 52
52 base::MessageLoop message_loop_; 53 base::MessageLoop message_loop_;
53 std::unique_ptr<NetworkStateHandler> network_state_handler_; 54 std::unique_ptr<NetworkStateHandler> network_state_handler_;
54 std::unique_ptr<TestingPrefServiceSimple> local_state_; 55 std::unique_ptr<TestingPrefServiceSimple> local_state_;
(...skipping 24 matching lines...) Expand all
79 80
80 // Clearing the preference should disable throttling 81 // Clearing the preference should disable throttling
81 EXPECT_CALL(*mock_manager_client_, 82 EXPECT_CALL(*mock_manager_client_,
82 SetNetworkThrottlingStatus(false, 0, 0, _, _)) 83 SetNetworkThrottlingStatus(false, 0, 0, _, _))
83 .Times(1); 84 .Times(1);
84 local_state_->ClearPref(prefs::kNetworkThrottlingEnabled); 85 local_state_->ClearPref(prefs::kNetworkThrottlingEnabled);
85 } 86 }
86 87
87 } // namespace test 88 } // namespace test
88 } // namespace chromeos 89 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698