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 |