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

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

Issue 1878313003: Convert //chrome/installer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert decompress.cc in mini_installer. Created 4 years, 8 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 "chrome/installer/util/delete_after_reboot_helper.h"
6
5 #include <windows.h> 7 #include <windows.h>
6 #include <shlobj.h> 8 #include <shlobj.h>
7 #include <stddef.h> 9 #include <stddef.h>
8 10
11 #include <memory>
12
9 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
10 #include "base/macros.h" 14 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
13 #include "base/win/registry.h" 16 #include "base/win/registry.h"
14 #include "chrome/installer/util/delete_after_reboot_helper.h"
15 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
16 18
17 namespace { 19 namespace {
18 20
19 // These tests exercise the Delete-After-Reboot code which requires 21 // These tests exercise the Delete-After-Reboot code which requires
20 // modifications to HKLM. This will fail on Vista and above if the user 22 // modifications to HKLM. This will fail on Vista and above if the user
21 // is not an admin or if UAC is on. 23 // is not an admin or if UAC is on.
22 // I tried using RegOverridePredefKey to test, but MoveFileEx ignore this 24 // I tried using RegOverridePredefKey to test, but MoveFileEx ignore this
23 // even on 32 bit machines :-( As such, running this test may pollute 25 // even on 32 bit machines :-( As such, running this test may pollute
24 // your PendingFileRenameOperations value. 26 // your PendingFileRenameOperations value.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 249
248 EXPECT_EQ(initial_pending_moves_size, pending_moves.size()); 250 EXPECT_EQ(initial_pending_moves_size, pending_moves.size());
249 251
250 std::vector<PendingMove>::const_iterator check_iter(pending_moves.begin()); 252 std::vector<PendingMove>::const_iterator check_iter(pending_moves.begin());
251 for (; check_iter != pending_moves.end(); ++check_iter) { 253 for (; check_iter != pending_moves.end(); ++check_iter) {
252 base::FilePath move_path(check_iter->first); 254 base::FilePath move_path(check_iter->first);
253 EXPECT_FALSE(MatchPendingDeletePath(short_temp_file, move_path)); 255 EXPECT_FALSE(MatchPendingDeletePath(short_temp_file, move_path));
254 } 256 }
255 } 257 }
256 258
OLDNEW
« no previous file with comments | « chrome/installer/util/create_reg_key_work_item_unittest.cc ('k') | chrome/installer/util/delete_reg_key_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698