Skip to content

Commit

Permalink
Add functionality to the install_static library to tokenize strings a…
Browse files Browse the repository at this point in the history
…nd compare versions.

This is required for the ongoing work to add crashpad integration in
chrome_elf and remove the crashpad integration from chrome.exe

As chrome_elf loads very early in the process, we cannot depend on
functionality from base which pulls in additional dependencies from
user32, etc.

I also added a target called install_static_unittests which contains tests
for the new functionality in install_static. The MatchPattern test has
been moved from chrome_elf to this executable.

The utf8_to_utf16 and utf16_to_utf8 functions in install_static are now public functions as they are
needed by crashpad.

The other changes in this patch are for getting the install_static
executable to run on the windows bots.

BUG=604923
TBR=dpranke

Review-Url: https://codereview.chromium.org/2017853002
Cr-Commit-Position: refs/heads/master@{#396612}
  • Loading branch information
ananta authored and Commit bot committed May 28, 2016
1 parent 6f77fb1 commit f2e54a9
Show file tree
Hide file tree
Showing 16 changed files with 435 additions and 70 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ group("both_gn_and_gyp") {
if (is_win) {
deps += [
"//base:pe_image_test",
"//chrome/install_static:install_static_unittests",
"//chrome/installer/setup:setup_unittests",
"//chrome_elf:chrome_elf_unittests",
"//chrome_elf:dll_hash_main",
Expand Down
1 change: 1 addition & 0 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
['OS=="win"', {
'dependencies': [
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:install_static_unittests',
'../chrome/chrome.gyp:setup_unittests',
# ../chrome/test/mini_installer requires mini_installer.
'../chrome/installer/mini_installer.gyp:mini_installer',
Expand Down
1 change: 1 addition & 0 deletions build/gn_migration.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@
'dependencies': [
'../base/base.gyp:pe_image_test',
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:install_static_unittests',
'../chrome/chrome.gyp:setup',
'../chrome/chrome.gyp:setup_unittests',
'../chrome/installer/mini_installer.gyp:mini_installer',
Expand Down
34 changes: 34 additions & 0 deletions chrome/chrome_installer_static.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,42 @@
},
},
},
{
'target_name': 'install_static_unittests',
'type': 'executable',
'sources': [
'install_static/install_util_unittest.cc',
],
'include_dirs': [
'..',
'<(SHARED_INTERMEDIATE_DIR)',
],
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:run_all_unittests',
'../base/base.gyp:test_support_base',
'chrome.gyp:install_static_util',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
],
},
],
}],
['OS=="win" and test_isolation_mode != "noop"', {
'targets': [
{
'target_name': 'install_static_unittests_run',
'type': 'none',
'dependencies': [
'install_static_unittests',
],
'includes': [ '../build/isolate.gypi' ],
'sources': [
'install_static/install_static_unittests.isolate'
],
},
],
}],
['OS=="win" and target_arch=="ia32"', {
'targets': [
{
Expand Down
16 changes: 16 additions & 0 deletions chrome/install_static/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ static_library("install_static_util") {
"//build/config/compiler:no_size_t_to_int_warning",
]
}

test("install_static_unittests") {
output_name = "install_static_unittests"
sources = [
"install_util_unittest.cc",
]
include_dirs = [ "$target_gen_dir" ]
deps = [
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//chrome/install_static:install_static_util",
"//testing/gmock",
"//testing/gtest",
]
}
17 changes: 17 additions & 0 deletions chrome/install_static/install_static_unittests.isolate
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2016 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.
{
'conditions': [
['OS=="win"', {
'variables': {
'command': [
'<(PRODUCT_DIR)/install_static_unittests<(EXECUTABLE_SUFFIX)',
],
},
}],
],
'includes': [
'../base/base.isolate',
],
}
Loading

0 comments on commit f2e54a9

Please sign in to comment.