summaryrefslogtreecommitdiffstats
path: root/chrome/installer/test
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-04-30 14:12:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 21:12:50 +0000
commitcb55755a09b9e2d8c5b05b7a4ad2ff8631e15b13 (patch)
treea923c6439926430dcfb9478c1e0310a77e301cb7 /chrome/installer/test
parent5ba44908beefb6aac6ace9608458c6d156b194c1 (diff)
downloadchromium_src-cb55755a09b9e2d8c5b05b7a4ad2ff8631e15b13.zip
chromium_src-cb55755a09b9e2d8c5b05b7a4ad2ff8631e15b13.tar.gz
chromium_src-cb55755a09b9e2d8c5b05b7a4ad2ff8631e15b13.tar.bz2
Add installer_util_unittests to the GN windows build
This fixes some C++ Warnings on Windows to avoid having to add suppressions to the GN build. Moves the generated strings header to the same place in the gen tree as it is in the source tree. Update includes. CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:android_chromium_gn_compile_dbg,android_chromium_gn_compile_rel;tryserver.chromium.win:win8_chromium_gn_rel,win8_chromium_gn_dbg;tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg Review URL: https://codereview.chromium.org/1062743006 Cr-Commit-Position: refs/heads/master@{#327790}
Diffstat (limited to 'chrome/installer/test')
-rw-r--r--chrome/installer/test/BUILD.gn60
-rw-r--r--chrome/installer/test/alternate_version_generator.cc6
-rw-r--r--chrome/installer/test/resource_updater.cc3
3 files changed, 65 insertions, 4 deletions
diff --git a/chrome/installer/test/BUILD.gn b/chrome/installer/test/BUILD.gn
new file mode 100644
index 0000000..ac4ef59
--- /dev/null
+++ b/chrome/installer/test/BUILD.gn
@@ -0,0 +1,60 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//testing/test.gni")
+
+assert(is_win)
+
+executable("alternate_version_generator") {
+ testonly = true
+ sources = [
+ "alternate_version_generator_main.cc",
+ ]
+
+ deps = [
+ ":alternate_version_generator_lib",
+ "//base",
+ "//base/test:test_support",
+ "//chrome/common:constants",
+ "//chrome/installer/util",
+ "//testing/gtest",
+ ]
+}
+
+source_set("alternate_version_generator_lib") {
+ testonly = true
+ sources = [
+ "alternate_version_generator.cc",
+ "alternate_version_generator.h",
+ "pe_image_resources.cc",
+ "pe_image_resources.h",
+ "resource_loader.cc",
+ "resource_loader.h",
+ "resource_updater.cc",
+ "resource_updater.h",
+ ]
+ deps = [
+ "//base",
+ "//chrome/installer/util",
+ "//chrome/common:constants",
+ ]
+}
+
+test("upgrade_test") {
+ sources = [
+ "run_all_tests.cc",
+ "upgrade_test.cc",
+ ]
+ deps = [
+ ":alternate_version_generator_lib",
+ "//base",
+ "//base/test:test_support",
+ "//chrome/common:constants",
+ "//chrome/installer/util",
+ "//testing/gtest",
+ ]
+ data_deps = [
+ # 'mini_installer.gyp:mini_installer', TODO(GYP)
+ ]
+}
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index e50c293..039c1ef 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -226,7 +226,7 @@ bool RunProcessAndWait(const wchar_t* exe_path, const std::wstring& cmdline,
<< cmdline << "\".";
result = false;
} else {
- DCHECK_NE(*exit_code, STILL_ACTIVE);
+ DCHECK_NE(*exit_code, static_cast<int>(STILL_ACTIVE));
}
}
} else {
@@ -547,7 +547,7 @@ bool GenerateAlternateVersion(const base::FilePath& original_installer_path,
base::WriteFile(setup_ex_,
reinterpret_cast<const char*>(resource_data.first),
static_cast<int>(resource_data.second));
- if (written != resource_data.second) {
+ if (written != static_cast<int>(resource_data.second)) {
LOG(DFATAL) << "Failed writing \"" << setup_ex_.value() << "\"";
return false;
}
@@ -559,7 +559,7 @@ bool GenerateAlternateVersion(const base::FilePath& original_installer_path,
base::WriteFile(chrome_packed_7z,
reinterpret_cast<const char*>(resource_data.first),
static_cast<int>(resource_data.second));
- if (written != resource_data.second) {
+ if (written != static_cast<int>(resource_data.second)) {
LOG(DFATAL) << "Failed writing \"" << chrome_packed_7z.value() << "\"";
return false;
}
diff --git a/chrome/installer/test/resource_updater.cc b/chrome/installer/test/resource_updater.cc
index cf05094..4c6be27 100644
--- a/chrome/installer/test/resource_updater.cc
+++ b/chrome/installer/test/resource_updater.cc
@@ -43,7 +43,8 @@ bool ResourceUpdater::Update(const std::wstring& name,
if (input.Initialize(input_file)) {
if (UpdateResource(handle_, type.c_str(), name.c_str(), language_id,
- const_cast<uint8*>(input.data()), input.length())
+ const_cast<uint8*>(input.data()),
+ static_cast<DWORD>(input.length()))
!= FALSE) {
return true;
}