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

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

Issue 477663004: Merged FakedDBusThreadManager with DBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <iostream> 5 #include <iostream>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chromeos/dbus/dbus_thread_manager.h" 14 #include "chromeos/dbus/dbus_thread_manager.h"
15 #include "chromeos/dbus/fake_dbus_thread_manager.h"
16 #include "chromeos/dbus/mock_shill_manager_client.h" 15 #include "chromeos/dbus/mock_shill_manager_client.h"
17 #include "chromeos/dbus/mock_shill_profile_client.h" 16 #include "chromeos/dbus/mock_shill_profile_client.h"
18 #include "chromeos/dbus/shill_client_helper.h" 17 #include "chromeos/dbus/shill_client_helper.h"
19 #include "chromeos/network/managed_network_configuration_handler_impl.h" 18 #include "chromeos/network/managed_network_configuration_handler_impl.h"
20 #include "chromeos/network/network_configuration_handler.h" 19 #include "chromeos/network/network_configuration_handler.h"
21 #include "chromeos/network/network_profile_handler.h" 20 #include "chromeos/network/network_profile_handler.h"
22 #include "chromeos/network/onc/onc_test_utils.h" 21 #include "chromeos/network/onc/onc_test_utils.h"
23 #include "chromeos/network/onc/onc_utils.h" 22 #include "chromeos/network/onc/onc_utils.h"
24 #include "dbus/object_path.h" 23 #include "dbus/object_path.h"
25 #include "testing/gmock/include/gmock/gmock.h" 24 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 public: 151 public:
153 ManagedNetworkConfigurationHandlerTest() 152 ManagedNetworkConfigurationHandlerTest()
154 : mock_manager_client_(NULL), 153 : mock_manager_client_(NULL),
155 mock_profile_client_(NULL) { 154 mock_profile_client_(NULL) {
156 } 155 }
157 156
158 virtual ~ManagedNetworkConfigurationHandlerTest() { 157 virtual ~ManagedNetworkConfigurationHandlerTest() {
159 } 158 }
160 159
161 virtual void SetUp() OVERRIDE { 160 virtual void SetUp() OVERRIDE {
162 FakeDBusThreadManager* dbus_thread_manager = new FakeDBusThreadManager; 161 scoped_ptr<DBusThreadManagerSetter> dbus_setter =
162 DBusThreadManager::GetSetterForTesting();
163 mock_manager_client_ = new StrictMock<MockShillManagerClient>(); 163 mock_manager_client_ = new StrictMock<MockShillManagerClient>();
164 mock_profile_client_ = new StrictMock<MockShillProfileClient>(); 164 mock_profile_client_ = new StrictMock<MockShillProfileClient>();
165 dbus_thread_manager->SetShillManagerClient( 165 dbus_setter->SetShillManagerClient(
166 scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass()); 166 scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass());
167 dbus_thread_manager->SetShillProfileClient( 167 dbus_setter->SetShillProfileClient(
168 scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass()); 168 scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass());
169 169
170 DBusThreadManager::InitializeForTesting(dbus_thread_manager);
171
172 SetNetworkConfigurationHandlerExpectations(); 170 SetNetworkConfigurationHandlerExpectations();
173 171
174 ON_CALL(*mock_profile_client_, GetProperties(_,_,_)) 172 ON_CALL(*mock_profile_client_, GetProperties(_,_,_))
175 .WillByDefault(Invoke(&profiles_stub_, 173 .WillByDefault(Invoke(&profiles_stub_,
176 &ShillProfileTestClient::GetProperties)); 174 &ShillProfileTestClient::GetProperties));
177 175
178 ON_CALL(*mock_profile_client_, GetEntry(_,_,_,_)) 176 ON_CALL(*mock_profile_client_, GetEntry(_,_,_,_))
179 .WillByDefault(Invoke(&profiles_stub_, 177 .WillByDefault(Invoke(&profiles_stub_,
180 &ShillProfileTestClient::GetEntry)); 178 &ShillProfileTestClient::GetEntry));
181 179
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 742
745 EXPECT_CALL(*mock_profile_client_, 743 EXPECT_CALL(*mock_profile_client_,
746 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); 744 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
747 745
748 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); 746 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
749 managed_network_configuration_handler_.reset(); 747 managed_network_configuration_handler_.reset();
750 message_loop_.RunUntilIdle(); 748 message_loop_.RunUntilIdle();
751 } 749 }
752 750
753 } // namespace chromeos 751 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/host_resolver_impl_chromeos_unittest.cc ('k') | chromeos/network/network_cert_migrator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698