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

Side by Side Diff: chrome/browser/extensions/api/mdns/dns_sd_registry_unittest.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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 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 "chrome/browser/extensions/api/mdns/dns_sd_registry.h" 5 #include "chrome/browser/extensions/api/mdns/dns_sd_registry.h"
6 #include "chrome/browser/extensions/api/mdns/dns_sd_delegate.h" 6 #include "chrome/browser/extensions/api/mdns/dns_sd_delegate.h"
7 #include "chrome/browser/extensions/api/mdns/dns_sd_device_lister.h" 7 #include "chrome/browser/extensions/api/mdns/dns_sd_device_lister.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 public: 72 public:
73 DnsSdRegistryTest() {} 73 DnsSdRegistryTest() {}
74 ~DnsSdRegistryTest() override {} 74 ~DnsSdRegistryTest() override {}
75 75
76 void SetUp() override { 76 void SetUp() override {
77 registry_.reset(new TestDnsSdRegistry()); 77 registry_.reset(new TestDnsSdRegistry());
78 registry_->AddObserver(&observer_); 78 registry_->AddObserver(&observer_);
79 } 79 }
80 80
81 protected: 81 protected:
82 scoped_ptr<TestDnsSdRegistry> registry_; 82 std::unique_ptr<TestDnsSdRegistry> registry_;
83 MockDnsSdObserver observer_; 83 MockDnsSdObserver observer_;
84 }; 84 };
85 85
86 // Tests registering 2 listeners and removing one. The device lister should 86 // Tests registering 2 listeners and removing one. The device lister should
87 // not be destroyed. 87 // not be destroyed.
88 TEST_F(DnsSdRegistryTest, RegisterUnregisterListeners) { 88 TEST_F(DnsSdRegistryTest, RegisterUnregisterListeners) {
89 const std::string service_type = "_testing._tcp.local"; 89 const std::string service_type = "_testing._tcp.local";
90 90
91 EXPECT_CALL(observer_, OnDnsSdEvent(service_type, 91 EXPECT_CALL(observer_, OnDnsSdEvent(service_type,
92 DnsSdRegistry::DnsSdServiceList())).Times(2); 92 DnsSdRegistry::DnsSdServiceList())).Times(2);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 service.ip_address = "192.168.0.100"; 255 service.ip_address = "192.168.0.100";
256 registry_->GetDelegate()->ServiceChanged(service_type, true, service); 256 registry_->GetDelegate()->ServiceChanged(service_type, true, service);
257 // Update with changed ip address. 257 // Update with changed ip address.
258 service.ip_address = "192.168.0.101"; 258 service.ip_address = "192.168.0.101";
259 registry_->GetDelegate()->ServiceChanged(service_type, false, service); 259 registry_->GetDelegate()->ServiceChanged(service_type, false, service);
260 // Update with no changes to the service. 260 // Update with no changes to the service.
261 registry_->GetDelegate()->ServiceChanged(service_type, false, service); 261 registry_->GetDelegate()->ServiceChanged(service_type, false, service);
262 } 262 }
263 263
264 } // namespace extensions 264 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/mdns/dns_sd_registry.cc ('k') | chrome/browser/extensions/api/mdns/mdns_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698