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

Side by Side Diff: net/proxy/proxy_resolver_factory_mojo_unittest.cc

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/proxy/proxy_resolver_factory_mojo.h" 5 #include "net/proxy/proxy_resolver_factory_mojo.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 public: 469 public:
470 enum Event { 470 enum Event {
471 DNS_REQUEST, 471 DNS_REQUEST,
472 }; 472 };
473 473
474 // HostResolver overrides. 474 // HostResolver overrides.
475 int Resolve(const RequestInfo& info, 475 int Resolve(const RequestInfo& info,
476 RequestPriority priority, 476 RequestPriority priority,
477 AddressList* addresses, 477 AddressList* addresses,
478 const CompletionCallback& callback, 478 const CompletionCallback& callback,
479 RequestHandle* request_handle, 479 std::unique_ptr<Request>* request_handle,
480 const BoundNetLog& source_net_log) override { 480 const BoundNetLog& source_net_log) override {
481 waiter_.NotifyEvent(DNS_REQUEST); 481 waiter_.NotifyEvent(DNS_REQUEST);
482 return ERR_IO_PENDING; 482 return ERR_IO_PENDING;
483 } 483 }
484 int ResolveFromCache(const RequestInfo& info, 484 int ResolveFromCache(const RequestInfo& info,
485 AddressList* addresses, 485 AddressList* addresses,
486 const BoundNetLog& source_net_log) override { 486 const BoundNetLog& source_net_log) override {
487 return ERR_DNS_CACHE_MISS; 487 return ERR_DNS_CACHE_MISS;
488 } 488 }
489 void CancelRequest(RequestHandle req) override {}
490 HostCache* GetHostCache() override { return nullptr; } 489 HostCache* GetHostCache() override { return nullptr; }
491 490
492 EventWaiter<Event>& waiter() { return waiter_; } 491 EventWaiter<Event>& waiter() { return waiter_; }
493 492
494 private: 493 private:
495 EventWaiter<Event> waiter_; 494 EventWaiter<Event> waiter_;
496 }; 495 };
497 496
498 void CheckCapturedNetLogEntries(const std::string& expected_string, 497 void CheckCapturedNetLogEntries(const std::string& expected_string,
499 const TestNetLogEntry::List& entries) { 498 const TestNetLogEntry::List& entries) {
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 mock_proxy_resolver_.ClearBlockedClients(); 895 mock_proxy_resolver_.ClearBlockedClients();
897 request->WaitForResult(); 896 request->WaitForResult();
898 } 897 }
899 898
900 TEST_F(ProxyResolverFactoryMojoTest, DeleteResolver) { 899 TEST_F(ProxyResolverFactoryMojoTest, DeleteResolver) {
901 CreateProxyResolver(); 900 CreateProxyResolver();
902 proxy_resolver_mojo_.reset(); 901 proxy_resolver_mojo_.reset();
903 on_delete_callback_.WaitForResult(); 902 on_delete_callback_.WaitForResult();
904 } 903 }
905 } // namespace net 904 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698