Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6897)

Unified Diff: chrome/installer/util/work_item_list_unittest.cc

Issue 412983002: Migrate WorkItemListTest to use RegistryOverrideManager instead of rolling its own attempt at temp … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, reenable tests. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/work_item_list_unittest.cc
diff --git a/chrome/installer/util/work_item_list_unittest.cc b/chrome/installer/util/work_item_list_unittest.cc
index 857987f6b0ba270345129ba51a8b072fe144bd34..3e4a77afab5c6af150641a1ff2b2cc2a57386615 100644
--- a/chrome/installer/util/work_item_list_unittest.cc
+++ b/chrome/installer/util/work_item_list_unittest.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
+#include "base/test/test_reg_util_win.h"
#include "base/win/registry.h"
#include "chrome/installer/util/conditional_work_item_list.h"
#include "chrome/installer/util/work_item.h"
@@ -27,32 +28,22 @@ const wchar_t kName[] = L"name";
class WorkItemListTest : public testing::Test {
protected:
virtual void SetUp() {
- // Create a temporary key for testing
- RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
- key.DeleteKey(kTestRoot);
- ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kTestRoot, KEY_READ));
- ASSERT_EQ(ERROR_SUCCESS,
- key.Create(HKEY_CURRENT_USER, kTestRoot, KEY_READ));
-
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"root_pit");
grt (UTC plus 2) 2014/07/23 22:03:59 this is so much better. thank you for doing the ri
}
virtual void TearDown() {
logging::CloseLogFile();
-
- // Clean up the temporary key
- RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
- ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kTestRoot));
}
base::ScopedTempDir temp_dir_;
+ registry_util::RegistryOverrideManager registry_override_manager_;
};
} // namespace
// Execute a WorkItem list successfully and then rollback.
-// http://crbug.com/396405
-TEST_F(WorkItemListTest, DISABLED_ExecutionSuccess) {
+TEST_F(WorkItemListTest, ExecutionSuccess) {
scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList());
scoped_ptr<WorkItem> work_item;
@@ -233,8 +224,7 @@ TEST_F(WorkItemListTest, ConditionalExecutionSuccess) {
EXPECT_FALSE(base::PathExists(top_dir_to_create));
}
-// http://crbug.com/396405
-TEST_F(WorkItemListTest, DISABLED_ConditionalExecutionConditionFailure) {
+TEST_F(WorkItemListTest, ConditionalExecutionConditionFailure) {
scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList());
scoped_ptr<WorkItem> work_item;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698