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

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

Issue 910343003: Create an in-process v8 proxy resolver using Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-complete-patch
Patch Set: Flag. Created 5 years, 10 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_mojo.h" 5 #include "net/proxy/proxy_resolver_mojo.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (result->close) { 164 if (result->close) {
165 client.reset(); 165 client.reset();
166 } else { 166 } else {
167 client->ReportResult(result->error, result->proxy_servers.Clone()); 167 client->ReportResult(result->error, result->proxy_servers.Clone());
168 } 168 }
169 } 169 }
170 170
171 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory { 171 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory {
172 public: 172 public:
173 TestMojoProxyResolverFactory(); 173 TestMojoProxyResolverFactory();
174 ~TestMojoProxyResolverFactory(); 174 ~TestMojoProxyResolverFactory() override;
175 175
176 // Overridden from MojoProxyResolverFactory: 176 // Overridden from MojoProxyResolverFactory:
177 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req, 177 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req,
178 interfaces::HostResolverPtr host_resolver) override; 178 interfaces::HostResolverPtr host_resolver) override;
179 179
180 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; } 180 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; }
181 181
182 void AddFuturePacScriptAction(int creation, SetPacScriptAction action); 182 void AddFuturePacScriptAction(int creation, SetPacScriptAction action);
183 183
184 int num_create_calls() const { return num_create_calls_; } 184 int num_create_calls() const { return num_create_calls_; }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 scoped_ptr<Request> request(MakeRequest(GURL("http://www.example.com"))); 526 scoped_ptr<Request> request(MakeRequest(GURL("http://www.example.com")));
527 mojo_proxy_resolver_factory_.GetMockResolver().CloseRequestClient( 527 mojo_proxy_resolver_factory_.GetMockResolver().CloseRequestClient(
528 GURL("http://www.example.com")); 528 GURL("http://www.example.com"));
529 EXPECT_EQ(ERR_IO_PENDING, request->Resolve()); 529 EXPECT_EQ(ERR_IO_PENDING, request->Resolve());
530 EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, request->WaitForResult()); 530 EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, request->WaitForResult());
531 531
532 EXPECT_TRUE(request->results().is_empty()); 532 EXPECT_TRUE(request->results().is_empty());
533 } 533 }
534 534
535 } // namespace net 535 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698