Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / installer / gcapi / gcapi_last_run_test.cc
index 503bb5f..85e7eed 100644 (file)
@@ -26,9 +26,7 @@ class GCAPILastRunTest : public ::testing::Test {
  protected:
   void SetUp() {
     // Override keys - this is undone during destruction.
-    std::wstring hkcu_override = base::StringPrintf(
-        L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID()));
-    override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override);
+    override_manager_.OverrideRegistry(HKEY_CURRENT_USER);
 
     // Create the client state key in the right places.
     std::wstring reg_path(google_update::kRegPathClientState);
@@ -36,7 +34,7 @@ class GCAPILastRunTest : public ::testing::Test {
     reg_path += google_update::kChromeUpgradeCode;
     RegKey client_state(HKEY_CURRENT_USER,
                         reg_path.c_str(),
-                        KEY_CREATE_SUB_KEY);
+                        KEY_CREATE_SUB_KEY | KEY_WOW64_32KEY);
     ASSERT_TRUE(client_state.Valid());
 
     // Place a bogus "pv" value in the right places to make the last run
@@ -46,7 +44,7 @@ class GCAPILastRunTest : public ::testing::Test {
     clients_path += google_update::kChromeUpgradeCode;
     RegKey client_key(HKEY_CURRENT_USER,
                       clients_path.c_str(),
-                      KEY_CREATE_SUB_KEY | KEY_SET_VALUE);
+                      KEY_CREATE_SUB_KEY | KEY_SET_VALUE | KEY_WOW64_32KEY);
     ASSERT_TRUE(client_key.Valid());
     client_key.WriteValue(L"pv", L"1.2.3.4");
   }
@@ -61,7 +59,8 @@ class GCAPILastRunTest : public ::testing::Test {
     path += L"\\";
     path += google_update::kChromeUpgradeCode;
 
-    RegKey client_state(HKEY_CURRENT_USER, path.c_str(), KEY_SET_VALUE);
+    RegKey client_state(
+        HKEY_CURRENT_USER, path.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY);
     return (client_state.Valid() &&
             client_state.WriteValue(
                 google_update::kRegLastRunTimeField,