| OLD | NEW |
| 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "chrome/browser/extensions/api/dial/dial_device_data.h" | 7 #include "chrome/browser/extensions/api/dial/dial_device_data.h" |
| 8 #include "chrome/browser/extensions/api/dial/dial_registry.h" | 8 #include "chrome/browser/extensions/api/dial/dial_registry.h" |
| 9 #include "chrome/browser/extensions/api/dial/dial_service.h" | 9 #include "chrome/browser/extensions/api/dial/dial_service.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // Returns the mock Dial service. | 58 // Returns the mock Dial service. |
| 59 MockDialService& mock_service() { | 59 MockDialService& mock_service() { |
| 60 return mock_service_; | 60 return mock_service_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Set to mock out the current time. | 63 // Set to mock out the current time. |
| 64 Time time_; | 64 Time time_; |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 virtual base::Time Now() const OVERRIDE { | 67 virtual base::Time Now() const override { |
| 68 return time_; | 68 return time_; |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual DialService* CreateDialService() OVERRIDE { | 71 virtual DialService* CreateDialService() override { |
| 72 return &mock_service_; | 72 return &mock_service_; |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void ClearDialService() OVERRIDE { | 75 virtual void ClearDialService() override { |
| 76 // Release the pointer but don't delete the object because the test owns it. | 76 // Release the pointer but don't delete the object because the test owns it. |
| 77 CHECK_EQ(&mock_service_, dial_.release()); | 77 CHECK_EQ(&mock_service_, dial_.release()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 MockDialService mock_service_; | 81 MockDialService mock_service_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class DialRegistryTest : public testing::Test { | 84 class DialRegistryTest : public testing::Test { |
| 85 public: | 85 public: |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET); | 357 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET); |
| 358 | 358 |
| 359 registry_->OnDiscoveryRequest(NULL); | 359 registry_->OnDiscoveryRequest(NULL); |
| 360 registry_->OnDeviceDiscovered(NULL, third_device_); | 360 registry_->OnDeviceDiscovered(NULL, third_device_); |
| 361 registry_->OnDiscoveryFinished(NULL); | 361 registry_->OnDiscoveryFinished(NULL); |
| 362 | 362 |
| 363 registry_->OnListenerRemoved(); | 363 registry_->OnListenerRemoved(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace extensions | 366 } // namespace extensions |
| OLD | NEW |