OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS); | 44 RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS); |
45 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kTestRoot)); | 45 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kTestRoot)); |
46 } | 46 } |
47 | 47 |
48 base::ScopedTempDir temp_dir_; | 48 base::ScopedTempDir temp_dir_; |
49 }; | 49 }; |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 // Execute a WorkItem list successfully and then rollback. | 53 // Execute a WorkItem list successfully and then rollback. |
54 TEST_F(WorkItemListTest, ExecutionSuccess) { | 54 // http://crbug.com/396405 |
| 55 TEST_F(WorkItemListTest, DISABLED_ExecutionSuccess) { |
55 scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); | 56 scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); |
56 scoped_ptr<WorkItem> work_item; | 57 scoped_ptr<WorkItem> work_item; |
57 | 58 |
58 base::FilePath top_dir_to_create(temp_dir_.path()); | 59 base::FilePath top_dir_to_create(temp_dir_.path()); |
59 top_dir_to_create = top_dir_to_create.AppendASCII("a"); | 60 top_dir_to_create = top_dir_to_create.AppendASCII("a"); |
60 base::FilePath dir_to_create(top_dir_to_create); | 61 base::FilePath dir_to_create(top_dir_to_create); |
61 dir_to_create = dir_to_create.AppendASCII("b"); | 62 dir_to_create = dir_to_create.AppendASCII("b"); |
62 ASSERT_FALSE(base::PathExists(dir_to_create)); | 63 ASSERT_FALSE(base::PathExists(dir_to_create)); |
63 | 64 |
64 work_item.reset(reinterpret_cast<WorkItem*>( | 65 work_item.reset(reinterpret_cast<WorkItem*>( |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 work_item_list->Rollback(); | 226 work_item_list->Rollback(); |
226 | 227 |
227 // Verify everything is rolled back. | 228 // Verify everything is rolled back. |
228 // The value must have been deleted first in roll back otherwise the key | 229 // The value must have been deleted first in roll back otherwise the key |
229 // can not be deleted. | 230 // can not be deleted. |
230 EXPECT_NE(ERROR_SUCCESS, | 231 EXPECT_NE(ERROR_SUCCESS, |
231 key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); | 232 key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); |
232 EXPECT_FALSE(base::PathExists(top_dir_to_create)); | 233 EXPECT_FALSE(base::PathExists(top_dir_to_create)); |
233 } | 234 } |
234 | 235 |
235 TEST_F(WorkItemListTest, ConditionalExecutionConditionFailure) { | 236 // http://crbug.com/396405 |
| 237 TEST_F(WorkItemListTest, DISABLED_ConditionalExecutionConditionFailure) { |
236 scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); | 238 scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); |
237 scoped_ptr<WorkItem> work_item; | 239 scoped_ptr<WorkItem> work_item; |
238 | 240 |
239 base::FilePath top_dir_to_create(temp_dir_.path()); | 241 base::FilePath top_dir_to_create(temp_dir_.path()); |
240 top_dir_to_create = top_dir_to_create.AppendASCII("a"); | 242 top_dir_to_create = top_dir_to_create.AppendASCII("a"); |
241 base::FilePath dir_to_create(top_dir_to_create); | 243 base::FilePath dir_to_create(top_dir_to_create); |
242 dir_to_create = dir_to_create.AppendASCII("b"); | 244 dir_to_create = dir_to_create.AppendASCII("b"); |
243 ASSERT_FALSE(base::PathExists(dir_to_create)); | 245 ASSERT_FALSE(base::PathExists(dir_to_create)); |
244 | 246 |
245 work_item.reset(reinterpret_cast<WorkItem*>( | 247 work_item.reset(reinterpret_cast<WorkItem*>( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 289 |
288 work_item_list->Rollback(); | 290 work_item_list->Rollback(); |
289 | 291 |
290 // Verify everything is rolled back. | 292 // Verify everything is rolled back. |
291 // The value must have been deleted first in roll back otherwise the key | 293 // The value must have been deleted first in roll back otherwise the key |
292 // can not be deleted. | 294 // can not be deleted. |
293 EXPECT_NE(ERROR_SUCCESS, | 295 EXPECT_NE(ERROR_SUCCESS, |
294 key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); | 296 key.Open(HKEY_CURRENT_USER, key_to_create.c_str(), KEY_READ)); |
295 EXPECT_FALSE(base::PathExists(top_dir_to_create)); | 297 EXPECT_FALSE(base::PathExists(top_dir_to_create)); |
296 } | 298 } |
OLD | NEW |