Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 9 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
| 10 #include "chromeos/dbus/fake_shill_device_client.h" | 10 #include "chromeos/dbus/fake_shill_device_client.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 class NetworkDeviceHandlerTest : public testing::Test { | 28 class NetworkDeviceHandlerTest : public testing::Test { |
| 29 public: | 29 public: |
| 30 NetworkDeviceHandlerTest() : fake_device_client_(NULL) {} | 30 NetworkDeviceHandlerTest() : fake_device_client_(NULL) {} |
| 31 virtual ~NetworkDeviceHandlerTest() {} | 31 virtual ~NetworkDeviceHandlerTest() {} |
| 32 | 32 |
| 33 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
| 34 FakeDBusThreadManager* dbus_manager = new FakeDBusThreadManager; | 34 FakeDBusThreadManager* dbus_manager = new FakeDBusThreadManager; |
| 35 dbus_manager->SetFakeShillClients(); | 35 dbus_manager->SetFakeShillClients(); |
| 36 DBusThreadManager::InitializeForTesting(dbus_manager); | |
|
pneubeck (no reviews)
2014/02/28 09:37:59
Do you change this order just to get rid of the de
stevenjb
2014/02/28 17:43:06
I see. This confused me, the behavior changed form
| |
| 36 | 37 |
| 38 // Set a new FakeShillDeviceClient (with no devices) after initialize | |
| 39 // dbus_manager. | |
| 37 fake_device_client_ = new FakeShillDeviceClient; | 40 fake_device_client_ = new FakeShillDeviceClient; |
| 38 dbus_manager->SetShillDeviceClient( | 41 dbus_manager->SetShillDeviceClient( |
| 39 scoped_ptr<ShillDeviceClient>(fake_device_client_)); | 42 scoped_ptr<ShillDeviceClient>(fake_device_client_)); |
| 40 DBusThreadManager::InitializeForTesting(dbus_manager); | |
| 41 | 43 |
| 42 success_callback_ = base::Bind(&NetworkDeviceHandlerTest::SuccessCallback, | 44 success_callback_ = base::Bind(&NetworkDeviceHandlerTest::SuccessCallback, |
| 43 base::Unretained(this)); | 45 base::Unretained(this)); |
| 44 properties_success_callback_ = | 46 properties_success_callback_ = |
| 45 base::Bind(&NetworkDeviceHandlerTest::PropertiesSuccessCallback, | 47 base::Bind(&NetworkDeviceHandlerTest::PropertiesSuccessCallback, |
| 46 base::Unretained(this)); | 48 base::Unretained(this)); |
| 47 string_success_callback_ = | 49 string_success_callback_ = |
| 48 base::Bind(&NetworkDeviceHandlerTest::StringSuccessCallback, | 50 base::Bind(&NetworkDeviceHandlerTest::StringSuccessCallback, |
| 49 base::Unretained(this)); | 51 base::Unretained(this)); |
| 50 error_callback_ = base::Bind(&NetworkDeviceHandlerTest::ErrorCallback, | 52 error_callback_ = base::Bind(&NetworkDeviceHandlerTest::ErrorCallback, |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 network_device_handler_->ChangePin(kUnknownCellularDevicePath, | 378 network_device_handler_->ChangePin(kUnknownCellularDevicePath, |
| 377 kOldPin, | 379 kOldPin, |
| 378 kNewPin, | 380 kNewPin, |
| 379 success_callback_, | 381 success_callback_, |
| 380 error_callback_); | 382 error_callback_); |
| 381 message_loop_.RunUntilIdle(); | 383 message_loop_.RunUntilIdle(); |
| 382 EXPECT_EQ(NetworkDeviceHandler::kErrorDeviceMissing, result_); | 384 EXPECT_EQ(NetworkDeviceHandler::kErrorDeviceMissing, result_); |
| 383 } | 385 } |
| 384 | 386 |
| 385 } // namespace chromeos | 387 } // namespace chromeos |
| OLD | NEW |