diff options
author | hnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 23:28:33 +0000 |
---|---|---|
committer | hnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-18 23:28:33 +0000 |
commit | 606788603dbb0d5ce1e9eac0e6009b5bcc308b65 (patch) | |
tree | 7eecd89c1a94f47648bbf7831c20ec1ec7796f87 /chrome/test/mini_installer_test | |
parent | c85316f83dc5d24b593fc9d082375bfb7dc49260 (diff) | |
download | chromium_src-606788603dbb0d5ce1e9eac0e6009b5bcc308b65.zip chromium_src-606788603dbb0d5ce1e9eac0e6009b5bcc308b65.tar.gz chromium_src-606788603dbb0d5ce1e9eac0e6009b5bcc308b65.tar.bz2 |
Update how standalone installer path is determined.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7629024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test')
3 files changed, 52 insertions, 48 deletions
diff --git a/chrome/test/mini_installer_test/mini_installer_test_constants.cc b/chrome/test/mini_installer_test/mini_installer_test_constants.cc index 32320bf..0b09c17 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_constants.cc +++ b/chrome/test/mini_installer_test/mini_installer_test_constants.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -57,10 +57,10 @@ const wchar_t kIEProcessName[] = L"IEXPLORE.EXE"; const wchar_t kChromeMetaInstallerExe[] = L"\\\\172.23.44.61\\shared\\chrome_autotest\\beta_build\\ChromeSetup.exe"; const wchar_t kChromeStandAloneInstallerLocation[] = - L"\\\\172.24.6.7\\shares\\googleclient\\nightly\\builds\\" - L"Win-OmahaInstallers\\latest\\opt-win\\staging\\"; + L"\\\\filer\\shares\\chromeclient\\builds\\ChromeSigning"; const wchar_t kChromeApplyTagExe[] = - L"\\\\172.23.44.61\\shared\\chrome_autotest\\ApplyTag.exe"; + L"\\\\filer\\shares\\googleclient\\save\\builds\\Omaha\\1.3.21.57" + L"\\opt\\tests\\ApplyTag.exe"; const wchar_t kChromeApplyTagParameters[] = L"\"appguid={8A69D345-D564-463C-AFF1-A69D9E530F96}" L"&appname=Chrome&needsadmin=false\""; diff --git a/chrome/test/mini_installer_test/mini_installer_test_util.cc b/chrome/test/mini_installer_test/mini_installer_test_util.cc index ce7520a..ec36231 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_util.cc +++ b/chrome/test/mini_installer_test/mini_installer_test_util.cc @@ -6,10 +6,12 @@ #include "chrome/test/mini_installer_test/mini_installer_test_util.h" +#include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/stringprintf.h" #include "base/string_split.h" #include "base/string_util.h" #include "base/test/test_timeouts.h" @@ -67,25 +69,23 @@ bool IsNewer(const FileInfo& file_rbegin, const FileInfo& file_rend) { return (file_rbegin.creation_time_ > file_rend.creation_time_); } -bool MiniInstallerTestUtil::GetCommandForTagging(std::wstring *return_command) { - FileInfoList file_details; - MiniInstallerTestUtil::GetStandaloneInstallerFileName(&file_details); - if (file_details.empty()) +bool MiniInstallerTestUtil::GetCommandForTagging( + std::wstring *return_command) { + std::wstring tagged_installer_path = MiniInstallerTestUtil::GetFilePath( + mini_installer_constants::kStandaloneInstaller); + FilePath standalone_installer_path; + if (!MiniInstallerTestUtil::GetStandaloneInstallerPath( + &standalone_installer_path)) { return false; - if (file_details.at(0).name_.empty()) - return false; - std::wstring standalone_installer_path; - standalone_installer_path.assign( - mini_installer_constants::kChromeStandAloneInstallerLocation); - standalone_installer_path.append(file_details.at(0).name_); - return_command->append(mini_installer_constants::kChromeApplyTagExe); - return_command->append(L" "); - return_command->append(standalone_installer_path); - return_command->append(L" "); - return_command->append(mini_installer_constants::kStandaloneInstaller); - return_command->append(L" "); - return_command->append(mini_installer_constants::kChromeApplyTagParameters); - VLOG(1) << "Command to run Apply tag: " << return_command->c_str(); + } + + VLOG(1) << "Tagging command: " << standalone_installer_path.value().c_str(); + *return_command = base::StringPrintf(L"%ls %ls %ls %ls", + mini_installer_constants::kChromeApplyTagExe, + standalone_installer_path.value().c_str(), + tagged_installer_path.c_str(), + mini_installer_constants::kChromeApplyTagParameters); + VLOG(1) << "Command to run Apply tag: " << return_command; return true; } @@ -228,34 +228,38 @@ bool MiniInstallerTestUtil::GetPreviousFullInstaller( return file_util::PathExists(installer); } -bool MiniInstallerTestUtil::GetStandaloneInstallerFileName( - FileInfoList *file_name) { +bool MiniInstallerTestUtil::GetStandaloneInstallerPath(FilePath* path) { + const CommandLine* cmd = CommandLine::ForCurrentProcess(); + std::wstring build = + cmd->GetSwitchValueNative(switches::kInstallerTestBuild); std::wstring standalone_installer( mini_installer_constants::kChromeStandAloneInstallerLocation); - standalone_installer.append(L"*.exe"); - return GetLatestFile(standalone_installer.c_str(), - mini_installer_constants::kUntaggedInstallerPattern, - file_name); + standalone_installer.append(L"\\" + build + L"\\win\\"); + + // Get the file name. + std::vector<std::wstring> tokenizedBuildNumber; + Tokenize(build, L".", &tokenizedBuildNumber); + std::wstring standalone_installer_filename = base::StringPrintf( + L"%ls%ls_%ls.exe", mini_installer_constants::kUntaggedInstallerPattern, + tokenizedBuildNumber[2].c_str(), tokenizedBuildNumber[3].c_str()); + standalone_installer.append(standalone_installer_filename); + + FilePath filename(standalone_installer); + if (!file_util::PathExists(filename)) + return false; + *path = filename; + return true; } bool MiniInstallerTestUtil::GetStandaloneVersion( - std::wstring* return_file_name) { - FileInfoList file_details; - GetStandaloneInstallerFileName(&file_details); - std::wstring file_name = file_details.at(0).name_; - // Returned file name will have following convention: - // ChromeStandaloneSetup_<build>_<patch>.exe - // Following code will extract build, patch details from the file - // and concatenate with 1.0 to form the build version. - // Patteren followed: 1.0.<build>.<patch>htt - file_name = file_name.substr(22, 25); - std::wstring::size_type last_dot = file_name.find(L'.'); - file_name = file_name.substr(0, last_dot); - std::wstring::size_type pos = file_name.find(L'_'); - file_name.replace(pos, 1, L"."); - file_name = L"3.0." + file_name; - return_file_name->assign(file_name.c_str()); - VLOG(1) << "Standalone installer version: " << file_name.c_str(); + std::wstring* version) { + const CommandLine* cmd = CommandLine::ForCurrentProcess(); + std::wstring build = + cmd->GetSwitchValueNative(switches::kInstallerTestBuild); + if (build.empty()) + return false; + *version = build; + VLOG(1) << "Standalone installer version: " << version; return true; } diff --git a/chrome/test/mini_installer_test/mini_installer_test_util.h b/chrome/test/mini_installer_test/mini_installer_test_util.h index a6e15b6..df7cae7 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_util.h +++ b/chrome/test/mini_installer_test/mini_installer_test_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. // @@ -83,8 +83,8 @@ class MiniInstallerTestUtil { static bool GetPreviousFullInstaller(const std::wstring& diff_file, std::wstring *previous, bool chrome_frame); - // This method will return standalone installer file name. - static bool GetStandaloneInstallerFileName(FileInfoList *file_name); + // Find stand alone installer path. + static bool GetStandaloneInstallerPath(FilePath* path); // This method will get the version number from the filename. static bool GetStandaloneVersion(std::wstring* version); |