diff --git a/chrome_browser_proxy_resolver.cc b/chrome_browser_proxy_resolver.cc
index a481f4f..abfec16 100644
--- a/chrome_browser_proxy_resolver.cc
+++ b/chrome_browser_proxy_resolver.cc
@@ -128,8 +128,8 @@
                                                   ProxiesResolvedFn callback,
                                                   void* data) {
   GError* error = NULL;
-  TEST_AND_RETURN_FALSE(proxy_);
-  if (!dbus_->ProxyCall(
+  guint timeout = timeout_;
+  if (!proxy_ || !dbus_->ProxyCall(
           proxy_,
           kLibCrosServiceResolveNetworkProxyMethodName,
           &error,
@@ -137,15 +137,16 @@
           G_TYPE_STRING, kLibCrosProxyResolveSignalInterface,
           G_TYPE_STRING, kLibCrosProxyResolveName,
           G_TYPE_INVALID, G_TYPE_INVALID)) {
-    LOG(ERROR) << "dbus_g_proxy_call failed: "
-               << utils::GetGErrorMessage(error);
-    return false;
+    LOG(WARNING) << "dbus_g_proxy_call failed: "
+                 << utils::GetGErrorMessage(error)
+                 << " Continuing with no proxy.";
+    timeout = 0;
   }
   callbacks_.insert(make_pair(url, make_pair(callback, data)));
   Closure* closure = NewCallback(this,
                                  &ChromeBrowserProxyResolver::HandleTimeout,
                                  url);
-  GSource* timer = g_timeout_source_new_seconds(timeout_);
+  GSource* timer = g_timeout_source_new_seconds(timeout);
   g_source_set_callback(timer, &utils::GlibRunClosure, closure, NULL);
   g_source_attach(timer, NULL);
   timers_.insert(make_pair(url, timer));
diff --git a/chrome_browser_proxy_resolver_unittest.cc b/chrome_browser_proxy_resolver_unittest.cc
index 09a8be7..9c29d85 100644
--- a/chrome_browser_proxy_resolver_unittest.cc
+++ b/chrome_browser_proxy_resolver_unittest.cc
@@ -107,7 +107,8 @@
 
 // chrome_replies should be set to whether or not we fake a reply from
 // chrome. If there's no reply, the resolver should time out.
-void RunTest(bool chrome_replies) {
+// If chrome_alive is false, assume that sending to chrome fails.
+void RunTest(bool chrome_replies, bool chrome_alive) {
   long number = 1;
   DBusGConnection* kMockSystemGBus =
       reinterpret_cast<DBusGConnection*>(number++);
@@ -123,11 +124,11 @@
   MockDbusGlib dbus_iface;
   
   EXPECT_CALL(dbus_iface, BusGet(_, _))
-      .Times(3)
+      .Times(chrome_alive ? 3 : 2)
       .WillRepeatedly(Return(kMockSystemGBus));
   EXPECT_CALL(dbus_iface,
               ConnectionGetConnection(kMockSystemGBus))
-      .Times(2)
+      .Times(chrome_alive ? 2 : 1)
       .WillRepeatedly(Return(kMockSystemBus));
   EXPECT_CALL(dbus_iface, DbusBusAddMatch(kMockSystemBus, _, _));
   EXPECT_CALL(dbus_iface,
@@ -139,16 +140,17 @@
                                    StrEq(kLibCrosServicePath),
                                    StrEq(kLibCrosServiceInterface),
                                    _))
-      .WillOnce(Return(kMockDbusProxy));
-  EXPECT_CALL(dbus_iface, ProxyCall(
-      kMockDbusProxy,
-      StrEq(kLibCrosServiceResolveNetworkProxyMethodName),
-      _,
-      G_TYPE_STRING, StrEq(kUrl),
-      G_TYPE_STRING, StrEq(kLibCrosProxyResolveSignalInterface),
-      G_TYPE_STRING, StrEq(kLibCrosProxyResolveName),
-      G_TYPE_INVALID))
-      .WillOnce(Return(TRUE));
+      .WillOnce(Return(chrome_alive ? kMockDbusProxy : NULL));
+  if (chrome_alive)
+    EXPECT_CALL(dbus_iface, ProxyCall(
+        kMockDbusProxy,
+        StrEq(kLibCrosServiceResolveNetworkProxyMethodName),
+        _,
+        G_TYPE_STRING, StrEq(kUrl),
+        G_TYPE_STRING, StrEq(kLibCrosProxyResolveSignalInterface),
+        G_TYPE_STRING, StrEq(kLibCrosProxyResolveName),
+        G_TYPE_INVALID))
+        .WillOnce(Return(chrome_alive ? TRUE : FALSE));
   EXPECT_CALL(dbus_iface,
               DbusConnectionRemoveFilter(kMockSystemBus, _, _));
   if (chrome_replies) {
@@ -172,7 +174,7 @@
   GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
 
   ChromeBrowserProxyResolver resolver(&dbus_iface);
-  EXPECT_TRUE(resolver.Init());
+  EXPECT_EQ(chrome_alive, resolver.Init());
   resolver.set_timeout(1);
   SendReplyArgs args = {
     kMockSystemBus,
@@ -192,47 +194,15 @@
 }  // namespace {}
 
 TEST(ChromeBrowserProxyResolverTest, SuccessTest) {
-  RunTest(true);
+  RunTest(true, true);
 }
 
 TEST(ChromeBrowserProxyResolverTest, NoReplyTest) {
-  RunTest(false);
+  RunTest(false, true);
 }
 
 TEST(ChromeBrowserProxyResolverTest, NoChromeTest) {
-  long number = 1;
-  DBusGConnection* kMockSystemGBus =
-      reinterpret_cast<DBusGConnection*>(number++);
-  DBusConnection* kMockSystemBus =
-      reinterpret_cast<DBusConnection*>(number++);
-
-  const char kUrl[] = "http://example.com/blah";
-
-  MockDbusGlib dbus_iface;
-  
-  EXPECT_CALL(dbus_iface, BusGet(_, _))
-      .Times(2)
-      .WillRepeatedly(Return(kMockSystemGBus));
-  EXPECT_CALL(dbus_iface,
-              ConnectionGetConnection(kMockSystemGBus))
-      .Times(1)
-      .WillOnce(Return(kMockSystemBus));
-  EXPECT_CALL(dbus_iface, DbusBusAddMatch(kMockSystemBus, _, _));
-  EXPECT_CALL(dbus_iface,
-              DbusConnectionAddFilter(kMockSystemBus, _, _, _))
-      .WillOnce(Return(1));
-  EXPECT_CALL(dbus_iface,
-              ProxyNewForNameOwner(kMockSystemGBus,
-                                   StrEq(kLibCrosServiceName),
-                                   StrEq(kLibCrosServicePath),
-                                   StrEq(kLibCrosServiceInterface),
-                                   _))
-      .WillOnce(Return(static_cast<DBusGProxy*>(NULL)));
-  EXPECT_CALL(dbus_iface,
-              DbusConnectionRemoveFilter(kMockSystemBus, _, _));
-  ChromeBrowserProxyResolver resolver(&dbus_iface);
-  EXPECT_FALSE(resolver.Init());
-  EXPECT_FALSE(resolver.GetProxiesForUrl(kUrl, NULL, NULL));
+  RunTest(false, false);
 }
 
 }  // namespace chromeos_update_engine
