| OLD | NEW |
| 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" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 public: | 173 public: |
| 174 ManagedNetworkConfigurationHandlerTest() | 174 ManagedNetworkConfigurationHandlerTest() |
| 175 : mock_manager_client_(NULL), | 175 : mock_manager_client_(NULL), |
| 176 mock_profile_client_(NULL), | 176 mock_profile_client_(NULL), |
| 177 mock_service_client_(NULL) { | 177 mock_service_client_(NULL) { |
| 178 } | 178 } |
| 179 | 179 |
| 180 virtual ~ManagedNetworkConfigurationHandlerTest() { | 180 virtual ~ManagedNetworkConfigurationHandlerTest() { |
| 181 } | 181 } |
| 182 | 182 |
| 183 virtual void SetUp() OVERRIDE { | 183 virtual void SetUp() override { |
| 184 scoped_ptr<DBusThreadManagerSetter> dbus_setter = | 184 scoped_ptr<DBusThreadManagerSetter> dbus_setter = |
| 185 DBusThreadManager::GetSetterForTesting(); | 185 DBusThreadManager::GetSetterForTesting(); |
| 186 mock_manager_client_ = new StrictMock<MockShillManagerClient>(); | 186 mock_manager_client_ = new StrictMock<MockShillManagerClient>(); |
| 187 mock_profile_client_ = new StrictMock<MockShillProfileClient>(); | 187 mock_profile_client_ = new StrictMock<MockShillProfileClient>(); |
| 188 mock_service_client_ = new StrictMock<MockShillServiceClient>(); | 188 mock_service_client_ = new StrictMock<MockShillServiceClient>(); |
| 189 dbus_setter->SetShillManagerClient( | 189 dbus_setter->SetShillManagerClient( |
| 190 scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass()); | 190 scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass()); |
| 191 dbus_setter->SetShillProfileClient( | 191 dbus_setter->SetShillProfileClient( |
| 192 scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass()); | 192 scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass()); |
| 193 dbus_setter->SetShillServiceClient( | 193 dbus_setter->SetShillServiceClient( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 215 new ManagedNetworkConfigurationHandlerImpl()); | 215 new ManagedNetworkConfigurationHandlerImpl()); |
| 216 managed_network_configuration_handler_->Init( | 216 managed_network_configuration_handler_->Init( |
| 217 NULL /* no NetworkStateHandler */, | 217 NULL /* no NetworkStateHandler */, |
| 218 network_profile_handler_.get(), | 218 network_profile_handler_.get(), |
| 219 network_configuration_handler_.get(), | 219 network_configuration_handler_.get(), |
| 220 NULL /* no DeviceHandler */); | 220 NULL /* no DeviceHandler */); |
| 221 | 221 |
| 222 message_loop_.RunUntilIdle(); | 222 message_loop_.RunUntilIdle(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 virtual void TearDown() OVERRIDE { | 225 virtual void TearDown() override { |
| 226 managed_network_configuration_handler_.reset(); | 226 managed_network_configuration_handler_.reset(); |
| 227 network_configuration_handler_.reset(); | 227 network_configuration_handler_.reset(); |
| 228 network_profile_handler_.reset(); | 228 network_profile_handler_.reset(); |
| 229 DBusThreadManager::Shutdown(); | 229 DBusThreadManager::Shutdown(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void VerifyAndClearExpectations() { | 232 void VerifyAndClearExpectations() { |
| 233 Mock::VerifyAndClearExpectations(mock_manager_client_); | 233 Mock::VerifyAndClearExpectations(mock_manager_client_); |
| 234 Mock::VerifyAndClearExpectations(mock_profile_client_); | 234 Mock::VerifyAndClearExpectations(mock_profile_client_); |
| 235 SetNetworkConfigurationHandlerExpectations(); | 235 SetNetworkConfigurationHandlerExpectations(); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 IsEqualTo(expected_shill_properties.get()), | 802 IsEqualTo(expected_shill_properties.get()), |
| 803 _, _)); | 803 _, _)); |
| 804 | 804 |
| 805 InitializeStandardProfiles(); | 805 InitializeStandardProfiles(); |
| 806 message_loop_.RunUntilIdle(); | 806 message_loop_.RunUntilIdle(); |
| 807 } | 807 } |
| 808 | 808 |
| 809 class ManagedNetworkConfigurationHandlerShutdownTest | 809 class ManagedNetworkConfigurationHandlerShutdownTest |
| 810 : public ManagedNetworkConfigurationHandlerTest { | 810 : public ManagedNetworkConfigurationHandlerTest { |
| 811 public: | 811 public: |
| 812 virtual void SetUp() OVERRIDE { | 812 virtual void SetUp() override { |
| 813 ManagedNetworkConfigurationHandlerTest::SetUp(); | 813 ManagedNetworkConfigurationHandlerTest::SetUp(); |
| 814 ON_CALL(*mock_profile_client_, GetProperties(_, _, _)).WillByDefault( | 814 ON_CALL(*mock_profile_client_, GetProperties(_, _, _)).WillByDefault( |
| 815 Invoke(&ManagedNetworkConfigurationHandlerShutdownTest::GetProperties)); | 815 Invoke(&ManagedNetworkConfigurationHandlerShutdownTest::GetProperties)); |
| 816 } | 816 } |
| 817 | 817 |
| 818 static void GetProperties( | 818 static void GetProperties( |
| 819 const dbus::ObjectPath& profile_path, | 819 const dbus::ObjectPath& profile_path, |
| 820 const ShillClientHelper::DictionaryValueCallbackWithoutStatus& callback, | 820 const ShillClientHelper::DictionaryValueCallbackWithoutStatus& callback, |
| 821 const ShillClientHelper::ErrorCallback& error_callback) { | 821 const ShillClientHelper::ErrorCallback& error_callback) { |
| 822 base::MessageLoop::current()->PostTask( | 822 base::MessageLoop::current()->PostTask( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 838 | 838 |
| 839 EXPECT_CALL(*mock_profile_client_, | 839 EXPECT_CALL(*mock_profile_client_, |
| 840 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); | 840 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); |
| 841 | 841 |
| 842 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); | 842 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); |
| 843 managed_network_configuration_handler_.reset(); | 843 managed_network_configuration_handler_.reset(); |
| 844 message_loop_.RunUntilIdle(); | 844 message_loop_.RunUntilIdle(); |
| 845 } | 845 } |
| 846 | 846 |
| 847 } // namespace chromeos | 847 } // namespace chromeos |
| OLD | NEW |