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

Side by Side Diff: chrome/installer/util/delete_reg_key_work_item_unittest.cc

Issue 1109043003: Apply automated fixits for Chrome clang plugin to chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <atlsecurity.h> // NOLINT 6 #include <atlsecurity.h> // NOLINT
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/win/registry.h" 9 #include "base/win/registry.h"
10 #include "chrome/installer/util/delete_reg_key_work_item.h" 10 #include "chrome/installer/util/delete_reg_key_work_item.h"
11 #include "chrome/installer/util/registry_test_data.h" 11 #include "chrome/installer/util/registry_test_data.h"
12 #include "chrome/installer/util/work_item.h" 12 #include "chrome/installer/util/work_item.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 using base::win::RegKey; 15 using base::win::RegKey;
16 16
17 class DeleteRegKeyWorkItemTest : public testing::Test { 17 class DeleteRegKeyWorkItemTest : public testing::Test {
18 protected: 18 protected:
19 static void TearDownTestCase() { 19 static void TearDownTestCase() {
20 logging::CloseLogFile(); 20 logging::CloseLogFile();
21 } 21 }
22 22
23 virtual void SetUp() { 23 void SetUp() override {
24 ASSERT_TRUE(test_data_.Initialize(HKEY_CURRENT_USER, L"SOFTWARE\\TmpTmp")); 24 ASSERT_TRUE(test_data_.Initialize(HKEY_CURRENT_USER, L"SOFTWARE\\TmpTmp"));
25 } 25 }
26 26
27 RegistryTestData test_data_; 27 RegistryTestData test_data_;
28 }; 28 };
29 29
30 // Test that deleting a key that doesn't exist succeeds, and that rollback does 30 // Test that deleting a key that doesn't exist succeeds, and that rollback does
31 // nothing. 31 // nothing.
32 TEST_F(DeleteRegKeyWorkItemTest, TestNoKey) { 32 TEST_F(DeleteRegKeyWorkItemTest, TestNoKey) {
33 const std::wstring key_paths[] = { 33 const std::wstring key_paths[] = {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 EXPECT_EQ(1U, dw_value); 130 EXPECT_EQ(1U, dw_value);
131 // Give users all access to the subkey so it can be deleted. 131 // Give users all access to the subkey so it can be deleted.
132 EXPECT_EQ(ERROR_SUCCESS, 132 EXPECT_EQ(ERROR_SUCCESS,
133 RegSetKeySecurity(key.Handle(), DACL_SECURITY_INFORMATION, 133 RegSetKeySecurity(key.Handle(), DACL_SECURITY_INFORMATION,
134 const_cast<SECURITY_DESCRIPTOR*>( 134 const_cast<SECURITY_DESCRIPTOR*>(
135 sec_desc.GetPSECURITY_DESCRIPTOR()))); 135 sec_desc.GetPSECURITY_DESCRIPTOR())));
136 EXPECT_EQ(ERROR_SUCCESS, key.OpenKey(L"Subkey2", KEY_QUERY_VALUE)); 136 EXPECT_EQ(ERROR_SUCCESS, key.OpenKey(L"Subkey2", KEY_QUERY_VALUE));
137 EXPECT_EQ(ERROR_SUCCESS, key.ReadValueDW(L"", &dw_value)); 137 EXPECT_EQ(ERROR_SUCCESS, key.ReadValueDW(L"", &dw_value));
138 EXPECT_EQ(2U, dw_value); 138 EXPECT_EQ(2U, dw_value);
139 } 139 }
OLDNEW
« no previous file with comments | « chrome/installer/util/delete_after_reboot_helper_unittest.cc ('k') | chrome/installer/util/delete_reg_value_work_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698