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

Unified Diff: net/proxy/proxy_service_mojo_unittest.cc

Issue 2110973002: Removing load_flags from ProxyService and ProxyDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service_mojo_unittest.cc
diff --git a/net/proxy/proxy_service_mojo_unittest.cc b/net/proxy/proxy_service_mojo_unittest.cc
index afa30076cc9e0aa1ed43c59db38e6708eac0ccf6..6f7d42a5672e2a5ccefeaef4dd82bb04dfdab413 100644
--- a/net/proxy/proxy_service_mojo_unittest.cc
+++ b/net/proxy/proxy_service_mojo_unittest.cc
@@ -6,21 +6,20 @@
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "net/base/load_flags.h"
#include "net/base/network_delegate_impl.h"
#include "net/base/test_completion_callback.h"
#include "net/dns/mock_host_resolver.h"
#include "net/log/net_log.h"
#include "net/log/test_net_log.h"
#include "net/log/test_net_log_entry.h"
#include "net/proxy/dhcp_proxy_script_fetcher.h"
#include "net/proxy/in_process_mojo_proxy_resolver_factory.h"
#include "net/proxy/mock_proxy_script_fetcher.h"
#include "net/proxy/mojo_proxy_resolver_factory.h"
@@ -153,45 +152,45 @@ class ProxyServiceMojoTest : public testing::Test,
MockProxyScriptFetcher* fetcher_; // Owned by |proxy_service_|.
TestNetLog net_log_;
TestClosure on_delete_closure_;
std::unique_ptr<ProxyService> proxy_service_;
};
TEST_F(ProxyServiceMojoTest, Basic) {
ProxyInfo info;
TestCompletionCallback callback;
EXPECT_EQ(ERR_IO_PENDING,
- proxy_service_->ResolveProxy(
- GURL("http://foo"), std::string(), LOAD_NORMAL, &info,
- callback.callback(), nullptr, nullptr, BoundNetLog()));
+ proxy_service_->ResolveProxy(GURL("http://foo"), std::string(),
+ &info, callback.callback(), nullptr,
+ nullptr, BoundNetLog()));
// Proxy script fetcher should have a fetch triggered by the first
// |ResolveProxy()| request.
EXPECT_TRUE(fetcher_->has_pending_request());
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kSimplePacScript);
EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("PROXY foo:1234", info.ToPacString());
EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
proxy_service_.reset();
on_delete_closure_.WaitForResult();
}
TEST_F(ProxyServiceMojoTest, DnsResolution) {
ProxyInfo info;
TestCompletionCallback callback;
BoundTestNetLog bound_net_log;
EXPECT_EQ(ERR_IO_PENDING,
- proxy_service_->ResolveProxy(
- GURL("http://foo"), std::string(), LOAD_NORMAL, &info,
- callback.callback(), nullptr, nullptr, bound_net_log.bound()));
+ proxy_service_->ResolveProxy(GURL("http://foo"), std::string(),
+ &info, callback.callback(), nullptr,
+ nullptr, bound_net_log.bound()));
// Proxy script fetcher should have a fetch triggered by the first
// |ResolveProxy()| request.
EXPECT_TRUE(fetcher_->has_pending_request());
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kDnsResolvePacScript);
EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("QUIC bar:4321", info.ToPacString());
EXPECT_EQ(1u, mock_host_resolver_.num_resolve());
@@ -206,23 +205,23 @@ TEST_F(ProxyServiceMojoTest, DnsResolution) {
return entry.type ==
NetLog::TYPE_HOST_RESOLVER_IMPL_JOB;
}));
}
TEST_F(ProxyServiceMojoTest, Error) {
ProxyInfo info;
TestCompletionCallback callback;
BoundTestNetLog bound_net_log;
EXPECT_EQ(ERR_IO_PENDING,
- proxy_service_->ResolveProxy(
- GURL("http://foo"), std::string(), LOAD_NORMAL, &info,
- callback.callback(), nullptr, nullptr, bound_net_log.bound()));
+ proxy_service_->ResolveProxy(GURL("http://foo"), std::string(),
+ &info, callback.callback(), nullptr,
+ nullptr, bound_net_log.bound()));
// Proxy script fetcher should have a fetch triggered by the first
// |ResolveProxy()| request.
EXPECT_TRUE(fetcher_->has_pending_request());
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kThrowingPacScript);
network_delegate_.event_waiter().WaitForEvent(
TestNetworkDelegate::PAC_SCRIPT_ERROR);
@@ -235,23 +234,23 @@ TEST_F(ProxyServiceMojoTest, Error) {
CheckCapturedNetLogEntries(entries);
entries.clear();
net_log_.GetEntries(&entries);
CheckCapturedNetLogEntries(entries);
}
TEST_F(ProxyServiceMojoTest, ErrorOnInitialization) {
ProxyInfo info;
TestCompletionCallback callback;
EXPECT_EQ(ERR_IO_PENDING,
- proxy_service_->ResolveProxy(
- GURL("http://foo"), std::string(), LOAD_NORMAL, &info,
- callback.callback(), nullptr, nullptr, BoundNetLog()));
+ proxy_service_->ResolveProxy(GURL("http://foo"), std::string(),
+ &info, callback.callback(), nullptr,
+ nullptr, BoundNetLog()));
// Proxy script fetcher should have a fetch triggered by the first
// |ResolveProxy()| request.
EXPECT_TRUE(fetcher_->has_pending_request());
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kThrowingOnLoadPacScript);
network_delegate_.event_waiter().WaitForEvent(
TestNetworkDelegate::PAC_SCRIPT_ERROR);
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698