| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | |
| 9 #include "base/registry.h" | 8 #include "base/registry.h" |
| 10 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 11 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 12 #include "chrome/installer/util/create_reg_key_work_item.h" | 11 #include "chrome/installer/util/create_reg_key_work_item.h" |
| 13 #include "chrome/installer/util/work_item.h" | 12 #include "chrome/installer/util/work_item.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 wchar_t test_root[] = L"TmpTmp"; | 16 wchar_t test_root[] = L"TmpTmp"; |
| 18 class CreateRegKeyWorkItemTest : public testing::Test { | 17 class CreateRegKeyWorkItemTest : public testing::Test { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_TRUE(key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), | 166 EXPECT_TRUE(key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), |
| 168 KEY_READ | KEY_SET_VALUE)); | 167 KEY_READ | KEY_SET_VALUE)); |
| 169 EXPECT_TRUE(key.WriteValue(L"name", L"value")); | 168 EXPECT_TRUE(key.WriteValue(L"name", L"value")); |
| 170 key.Close(); | 169 key.Close(); |
| 171 | 170 |
| 172 work_item->Rollback(); | 171 work_item->Rollback(); |
| 173 | 172 |
| 174 // Rollback should not remove the key. | 173 // Rollback should not remove the key. |
| 175 EXPECT_TRUE(key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); | 174 EXPECT_TRUE(key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); |
| 176 } | 175 } |
| OLD | NEW |