Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / policy / device_cloud_policy_store_chromeos_unittest.cc
index 6550baf..f386070 100644 (file)
@@ -18,6 +18,7 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chromeos/cryptohome/cryptohome_util.h"
 #include "chromeos/dbus/fake_cryptohome_client.h"
+#include "chromeos/dbus/fake_dbus_thread_manager.h"
 #include "policy/policy_constants.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -41,12 +42,13 @@ class DeviceCloudPolicyStoreChromeOSTest
       : local_state_(TestingBrowserProcess::GetGlobal()),
         fake_cryptohome_client_(new chromeos::FakeCryptohomeClient()),
         install_attributes_(
-            new EnterpriseInstallAttributes(fake_cryptohome_client_.get())),
+            new EnterpriseInstallAttributes(fake_cryptohome_client_)),
         store_(new DeviceCloudPolicyStoreChromeOS(
             &device_settings_service_,
             install_attributes_.get(),
             base::MessageLoopProxy::current())) {
-    fake_cryptohome_client_->Init(NULL /* no dbus::Bus */);
+    fake_dbus_thread_manager_->SetCryptohomeClient(
+        scoped_ptr<chromeos::CryptohomeClient>(fake_cryptohome_client_));
   }
 
   virtual void SetUp() OVERRIDE {
@@ -103,8 +105,8 @@ class DeviceCloudPolicyStoreChromeOSTest
     store_.reset();
     chromeos::cryptohome_util::InstallAttributesSet("enterprise.owned",
                                                     std::string());
-    install_attributes_.reset(new EnterpriseInstallAttributes(
-        fake_cryptohome_client_.get()));
+    install_attributes_.reset(
+        new EnterpriseInstallAttributes(fake_cryptohome_client_));
     store_.reset(
         new DeviceCloudPolicyStoreChromeOS(&device_settings_service_,
                                            install_attributes_.get(),
@@ -112,7 +114,7 @@ class DeviceCloudPolicyStoreChromeOSTest
   }
 
   ScopedTestingLocalState local_state_;
-  scoped_ptr<chromeos::FakeCryptohomeClient> fake_cryptohome_client_;
+  chromeos::FakeCryptohomeClient* fake_cryptohome_client_;
   scoped_ptr<EnterpriseInstallAttributes> install_attributes_;
 
   scoped_ptr<DeviceCloudPolicyStoreChromeOS> store_;