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

Side by Side Diff: chromeos/network/network_configuration_handler_unittest.cc

Issue 708563005: Use setProperties for IP Config. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430113_internet_options_1
Patch Set: Add managed indicator to userNameServers, feedback, fix tests Created 5 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 EXPECT_CALL(*mock_service_client_, GetProperties(_, _)).Times(AnyNumber()); 192 EXPECT_CALL(*mock_service_client_, GetProperties(_, _)).Times(AnyNumber());
193 EXPECT_CALL(*mock_manager_client_, GetProperties(_)).Times(AnyNumber()); 193 EXPECT_CALL(*mock_manager_client_, GetProperties(_)).Times(AnyNumber());
194 EXPECT_CALL(*mock_manager_client_, AddPropertyChangedObserver(_)) 194 EXPECT_CALL(*mock_manager_client_, AddPropertyChangedObserver(_))
195 .Times(AnyNumber()); 195 .Times(AnyNumber());
196 EXPECT_CALL(*mock_manager_client_, RemovePropertyChangedObserver(_)) 196 EXPECT_CALL(*mock_manager_client_, RemovePropertyChangedObserver(_))
197 .Times(AnyNumber()); 197 .Times(AnyNumber());
198 198
199 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); 199 network_state_handler_.reset(NetworkStateHandler::InitializeForTest());
200 network_configuration_handler_.reset(new NetworkConfigurationHandler()); 200 network_configuration_handler_.reset(new NetworkConfigurationHandler());
201 network_configuration_handler_->Init(network_state_handler_.get()); 201 network_configuration_handler_->Init(network_state_handler_.get(),
202 NULL /* network_device_handler */);
202 message_loop_.RunUntilIdle(); 203 message_loop_.RunUntilIdle();
203 } 204 }
204 205
205 virtual void TearDown() override { 206 virtual void TearDown() override {
206 network_configuration_handler_.reset(); 207 network_configuration_handler_.reset();
207 network_state_handler_.reset(); 208 network_state_handler_.reset();
208 DBusThreadManager::Shutdown(); 209 DBusThreadManager::Shutdown();
209 } 210 }
210 211
211 // Handles responses for GetProperties method calls. 212 // Handles responses for GetProperties method calls.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 virtual ~NetworkConfigurationHandlerStubTest() {} 484 virtual ~NetworkConfigurationHandlerStubTest() {}
484 485
485 virtual void SetUp() override { 486 virtual void SetUp() override {
486 DBusThreadManager::Initialize(); 487 DBusThreadManager::Initialize();
487 488
488 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); 489 network_state_handler_.reset(NetworkStateHandler::InitializeForTest());
489 test_observer_.reset(new TestObserver()); 490 test_observer_.reset(new TestObserver());
490 network_state_handler_->AddObserver(test_observer_.get(), FROM_HERE); 491 network_state_handler_->AddObserver(test_observer_.get(), FROM_HERE);
491 492
492 network_configuration_handler_.reset(new NetworkConfigurationHandler()); 493 network_configuration_handler_.reset(new NetworkConfigurationHandler());
493 network_configuration_handler_->Init(network_state_handler_.get()); 494 network_configuration_handler_->Init(network_state_handler_.get(),
495 NULL /* network_device_handler */);
494 496
495 message_loop_.RunUntilIdle(); 497 message_loop_.RunUntilIdle();
496 test_observer_->ClearPropertyUpdates(); 498 test_observer_->ClearPropertyUpdates();
497 } 499 }
498 500
499 virtual void TearDown() override { 501 virtual void TearDown() override {
500 network_configuration_handler_.reset(); 502 network_configuration_handler_.reset();
501 network_state_handler_->RemoveObserver(test_observer_.get(), FROM_HERE); 503 network_state_handler_->RemoveObserver(test_observer_.get(), FROM_HERE);
502 network_state_handler_.reset(); 504 network_state_handler_.reset();
503 DBusThreadManager::Shutdown(); 505 DBusThreadManager::Shutdown();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 EXPECT_FALSE(test_observer->HasConfiguration(service_path)); 733 EXPECT_FALSE(test_observer->HasConfiguration(service_path));
732 EXPECT_FALSE(test_observer->HasConfigurationInProfile( 734 EXPECT_FALSE(test_observer->HasConfigurationInProfile(
733 service_path, NetworkProfileHandler::GetSharedProfilePath())); 735 service_path, NetworkProfileHandler::GetSharedProfilePath()));
734 EXPECT_FALSE( 736 EXPECT_FALSE(
735 test_observer->HasConfigurationInProfile(service_path, user_profile)); 737 test_observer->HasConfigurationInProfile(service_path, user_profile));
736 738
737 network_configuration_handler_->RemoveObserver(test_observer.get()); 739 network_configuration_handler_->RemoveObserver(test_observer.get());
738 } 740 }
739 741
740 } // namespace chromeos 742 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698