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

Unified Diff: net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc

Issue 2929153002: Use URLRequestContextBuilderMojo to create the SystemURLRequestContext. (Closed)
Patch Set: Merge Created 3 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 side-by-side diff with in-line comments
Download patch
Index: net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc
diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc b/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc
index 71d67e79be2f0694561f80cb2c4ab1e18186ece6..700778f21de7c9612debe33604e39bf40a13325b 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc
@@ -10,51 +10,26 @@
namespace net {
namespace {
-TEST(DhcpProxyScriptFetcherFactoryTest, DoNothingWhenDisabled) {
- DhcpProxyScriptFetcherFactory factory;
- factory.set_enabled(false);
- std::unique_ptr<DhcpProxyScriptFetcher> fetcher(factory.Create(NULL));
- EXPECT_EQ("", fetcher->GetFetcherName());
-}
-
#if defined(OS_WIN)
TEST(DhcpProxyScriptFetcherFactoryTest, WindowsFetcherOnWindows) {
DhcpProxyScriptFetcherFactory factory;
- factory.set_enabled(true);
-
- std::unique_ptr<TestURLRequestContext> context(new TestURLRequestContext());
- std::unique_ptr<DhcpProxyScriptFetcher> fetcher(
- factory.Create(context.get()));
+ TestURLRequestContext context;
+ std::unique_ptr<DhcpProxyScriptFetcher> fetcher(factory.Create(&context));
+ ASSERT_TRUE(fetcher.get());
EXPECT_EQ("win", fetcher->GetFetcherName());
}
-#endif // defined(OS_WIN)
-TEST(DhcpProxyScriptFetcherFactoryTest, IsSupported) {
-#if defined(OS_WIN)
- ASSERT_TRUE(DhcpProxyScriptFetcherFactory::IsSupported());
-#else
- ASSERT_FALSE(DhcpProxyScriptFetcherFactory::IsSupported());
-#endif // defined(OS_WIN)
-}
+#else // !defined(OS_WIN)
-TEST(DhcpProxyScriptFetcherFactoryTest, SetEnabled) {
+TEST(DhcpProxyScriptFetcherFactoryTest, ReturnNullOnUnsupportedPlatforms) {
DhcpProxyScriptFetcherFactory factory;
-#if defined(OS_WIN)
- EXPECT_TRUE(factory.enabled());
-#else
- EXPECT_FALSE(factory.enabled());
-#endif // defined(OS_WIN)
-
- factory.set_enabled(false);
- EXPECT_FALSE(factory.enabled());
+ TestURLRequestContext context;
+ std::unique_ptr<DhcpProxyScriptFetcher> fetcher(factory.Create(&context));
+ ASSERT_TRUE(fetcher.get());
+ EXPECT_EQ("do nothing", fetcher->GetFetcherName());
+}
- factory.set_enabled(true);
-#if defined(OS_WIN)
- EXPECT_TRUE(factory.enabled());
-#else
- EXPECT_FALSE(factory.enabled());
#endif // defined(OS_WIN)
-}
} // namespace
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698