diff options
author | hnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 01:52:47 +0000 |
---|---|---|
committer | hnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 01:52:47 +0000 |
commit | 85630ddb424cf3e826e0aa11b20fa2c24ed8633a (patch) | |
tree | 7b83d1a9b57b57da8654d3932b8582f1f3909465 /chrome/test/mini_installer_test/installer_path_provider.h | |
parent | 6ef2f6b20e5feb4868a4d93cd4737fd523e0ff59 (diff) | |
download | chromium_src-85630ddb424cf3e826e0aa11b20fa2c24ed8633a.zip chromium_src-85630ddb424cf3e826e0aa11b20fa2c24ed8633a.tar.gz chromium_src-85630ddb424cf3e826e0aa11b20fa2c24ed8633a.tar.bz2 |
A few things in this rewrite:
1) Move test logics into the tests
2) Simplify test installer
3) Separate code to locate installers into a new class
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8464001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test/installer_path_provider.h')
-rw-r--r-- | chrome/test/mini_installer_test/installer_path_provider.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/chrome/test/mini_installer_test/installer_path_provider.h b/chrome/test/mini_installer_test/installer_path_provider.h new file mode 100644 index 0000000..e7eb60f --- /dev/null +++ b/chrome/test/mini_installer_test/installer_path_provider.h @@ -0,0 +1,50 @@ +// 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. + +#ifndef CHROME_TEST_MINI_INSTALLER_TEST_INSTALLER_PATH_PROVIDER_H_ +#define CHROME_TEST_MINI_INSTALLER_TEST_INSTALLER_PATH_PROVIDER_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/file_path.h" + +namespace installer_test { + +// Locate and provides path for installers. +// Search for latest installer binaries in the filer directory defined by +// mini_installer_constants::kChromeInstallersLocation. +class InstallerPathProvider { + public: + // Search for latest installer binaries in filer. + InstallerPathProvider(); + + explicit InstallerPathProvider(const std::string& build_under_test); + ~InstallerPathProvider(); + + bool GetFullInstaller(FilePath* path); + bool GetDiffInstaller(FilePath* path); + bool GetMiniInstaller(FilePath* path); + bool GetPreviousInstaller(FilePath* path); + bool GetStandaloneInstaller(FilePath* path); + bool GetSignedStandaloneInstaller(FilePath* path); + + std::string GetCurrentBuild(); + std::string GetPreviousBuild(); + + private: + // Returns the local file path for the given file |name|. + // Assumes file is located in the current working directory. + FilePath PathFromExeDir(const FilePath::StringType& name); + + bool GetInstaller(const std::string& pattern, FilePath* path); + + // Build numbers. + std::string current_build_, previous_build_; + + DISALLOW_COPY_AND_ASSIGN(InstallerPathProvider); +}; + +} // namespace + +#endif // CHROME_TEST_MINI_INSTALLER_TEST_INSTALLER_PATH_PROVIDER_H_ |