Default to allowing updates when we can't determine the network type.
BUG=None
TEST=Manual -- kill shill.
Change-Id: Ibed384b42ef461d0fb728f587c8e3d15c76a6de1
Reviewed-on: https://chromium-review.googlesource.com/176021
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
index 3b3ffe5..140bf81 100644
--- a/http_fetcher_unittest.cc
+++ b/http_fetcher_unittest.cc
@@ -824,6 +824,16 @@
scoped_ptr<HttpFetcher> fetcher(this->test_.NewSmallFetcher());
fetcher->set_delegate(&delegate);
+ // Don't allow connection to server by denying access over ethernet.
+ MockConnectionManager* mock_cm = dynamic_cast<MockConnectionManager*>(
+ fetcher->GetSystemState()->connection_manager());
+ EXPECT_CALL(*mock_cm, GetConnectionType(_,_))
+ .WillRepeatedly(DoAll(SetArgumentPointee<1>(kNetEthernet), Return(true)));
+ EXPECT_CALL(*mock_cm, IsUpdateAllowedOver(kNetEthernet))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_cm, StringForConnectionType(kNetEthernet))
+ .WillRepeatedly(Return(shill::kTypeEthernet));
+
StartTransferArgs start_xfer_args = {
fetcher.get(),
LocalServerUrlForPath(0,
@@ -832,7 +842,6 @@
kFlakySleepEvery,
kFlakySleepSecs))
};
-
g_timeout_add(0, StartTransfer, &start_xfer_args);
g_main_loop_run(loop);