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

Side by Side Diff: chrome/installer/test/resource_updater.cc

Issue 1116263002: Revert of Add installer_util_unittests to the GN windows build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wintests3
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
« no previous file with comments | « chrome/installer/test/alternate_version_generator.cc ('k') | chrome/installer/upgrade_test.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/test/resource_updater.h" 5 #include "chrome/installer/test/resource_updater.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/memory_mapped_file.h" 10 #include "base/files/memory_mapped_file.h"
(...skipping 25 matching lines...) Expand all
36 36
37 bool ResourceUpdater::Update(const std::wstring& name, 37 bool ResourceUpdater::Update(const std::wstring& name,
38 const std::wstring& type, 38 const std::wstring& type,
39 WORD language_id, 39 WORD language_id,
40 const base::FilePath& input_file) { 40 const base::FilePath& input_file) {
41 DCHECK(handle_ != NULL); 41 DCHECK(handle_ != NULL);
42 base::MemoryMappedFile input; 42 base::MemoryMappedFile input;
43 43
44 if (input.Initialize(input_file)) { 44 if (input.Initialize(input_file)) {
45 if (UpdateResource(handle_, type.c_str(), name.c_str(), language_id, 45 if (UpdateResource(handle_, type.c_str(), name.c_str(), language_id,
46 const_cast<uint8*>(input.data()), 46 const_cast<uint8*>(input.data()), input.length())
47 static_cast<DWORD>(input.length()))
48 != FALSE) { 47 != FALSE) {
49 return true; 48 return true;
50 } 49 }
51 PLOG(DFATAL) << "UpdateResource failed for resource \"" << name << "\""; 50 PLOG(DFATAL) << "UpdateResource failed for resource \"" << name << "\"";
52 } else { 51 } else {
53 PLOG(DFATAL) << "Failed mapping \"" << input_file.value() << "\""; 52 PLOG(DFATAL) << "Failed mapping \"" << input_file.value() << "\"";
54 } 53 }
55 return false; 54 return false;
56 } 55 }
57 56
58 bool ResourceUpdater::Commit() { 57 bool ResourceUpdater::Commit() {
59 DCHECK(handle_ != NULL); 58 DCHECK(handle_ != NULL);
60 bool result = true; 59 bool result = true;
61 if (EndUpdateResource(handle_, FALSE) == FALSE) { 60 if (EndUpdateResource(handle_, FALSE) == FALSE) {
62 PLOG(DFATAL) << "EndUpdateResource failed"; 61 PLOG(DFATAL) << "EndUpdateResource failed";
63 result = false; 62 result = false;
64 } 63 }
65 handle_ = NULL; 64 handle_ = NULL;
66 return result; 65 return result;
67 } 66 }
68 67
69 } // namespace upgrade_test 68 } // namespace upgrade_test
OLDNEW
« no previous file with comments | « chrome/installer/test/alternate_version_generator.cc ('k') | chrome/installer/upgrade_test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698