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

Side by Side Diff: chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency Created 4 years, 6 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
« no previous file with comments | « base/mac/scoped_typeref.h ('k') | chrome/browser/notifications/notification_builder_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 net::SockaddrStorage storage; 133 net::SockaddrStorage storage;
134 ASSERT_TRUE(endpoint.ToSockAddr(storage.addr, &storage.addr_len)); 134 ASSERT_TRUE(endpoint.ToSockAddr(storage.addr, &storage.addr_len));
135 NSData* discoveryHost = 135 NSData* discoveryHost =
136 [NSData dataWithBytes:storage.addr length:storage.addr_len]; 136 [NSData dataWithBytes:storage.addr length:storage.addr_len];
137 NSArray* addresses = @[ discoveryHost ]; 137 NSArray* addresses = @[ discoveryHost ];
138 [test_service setAddresses:addresses]; 138 [test_service setAddresses:addresses];
139 139
140 ServiceResolverImplMac* resolver_impl = 140 ServiceResolverImplMac* resolver_impl =
141 static_cast<ServiceResolverImplMac*>(resolver.get()); 141 static_cast<ServiceResolverImplMac*>(resolver.get());
142 resolver_impl->GetContainerForTesting()->SetServiceForTesting( 142 resolver_impl->GetContainerForTesting()->SetServiceForTesting(
143 test_service.release()); 143 base::scoped_nsobject<NSNetService>(test_service));
144 resolver->StartResolving(); 144 resolver->StartResolving();
145 145
146 resolver_impl->GetContainerForTesting()->OnResolveUpdate( 146 resolver_impl->GetContainerForTesting()->OnResolveUpdate(
147 ServiceResolver::STATUS_SUCCESS); 147 ServiceResolver::STATUS_SUCCESS);
148 148
149 base::MessageLoop::current()->RunUntilIdle(); 149 base::MessageLoop::current()->RunUntilIdle();
150 150
151 EXPECT_EQ(1, num_resolves_); 151 EXPECT_EQ(1, num_resolves_);
152 EXPECT_EQ(2u, last_service_description_.metadata.size()); 152 EXPECT_EQ(2u, last_service_description_.metadata.size());
153 EXPECT_EQ(ip_address, last_service_description_.ip_address); 153 EXPECT_EQ(ip_address, last_service_description_.ip_address);
154 EXPECT_EQ(kPort, last_service_description_.address.port()); 154 EXPECT_EQ(kPort, last_service_description_.address.port());
155 EXPECT_EQ(kIp, last_service_description_.address.host()); 155 EXPECT_EQ(kIp, last_service_description_.address.host());
156 } 156 }
157 157
158 } // namespace local_discovery 158 } // namespace local_discovery
OLDNEW
« no previous file with comments | « base/mac/scoped_typeref.h ('k') | chrome/browser/notifications/notification_builder_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698