blob: 87e9eef46f30c817d1139d63002707c54573cbc4 [file] [log] [blame]
[email protected]6188a8fe2011-01-28 19:31:551// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]c744d292010-11-23 15:01:222// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Boilerplate for an upgrade scenario test. The mini_installer.exe residing in
6// the same directory as the host executable is re-versioned.
7
8#include "base/file_path.h"
9#include "base/file_util.h"
10#include "base/path_service.h"
11#include "chrome/installer/test/alternate_version_generator.h"
12#include "testing/gtest/include/gtest/gtest.h"
13
14namespace {
15 const wchar_t kMiniInstallerExe[] = L"mini_installer.exe";
16} // namespace
17
18// Boilerplate for a future upgrade scenario test.
19class UpgradeTest : public testing::Test {
20 public:
21 // Generate a newer version of mini_installer.exe.
22 static void SetUpTestCase() {
[email protected]152ea302013-02-11 04:08:4023 base::FilePath dir_exe;
[email protected]c744d292010-11-23 15:01:2224 ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dir_exe));
25 ASSERT_TRUE(file_util::CreateTemporaryFile(&next_mini_installer_path_));
26 ASSERT_TRUE(
[email protected]6188a8fe2011-01-28 19:31:5527 upgrade_test::GenerateAlternateVersion(
28 dir_exe.Append(&kMiniInstallerExe[0]),
29 next_mini_installer_path_,
30 upgrade_test::NEXT_VERSION, NULL, NULL));
[email protected]c744d292010-11-23 15:01:2231 }
32
33 // Clean up by deleting the created newer version of mini_installer.exe.
34 static void TearDownTestCase() {
35 EXPECT_TRUE(file_util::Delete(next_mini_installer_path_, false));
36 }
37 private:
[email protected]152ea302013-02-11 04:08:4038 static base::FilePath next_mini_installer_path_;
[email protected]c744d292010-11-23 15:01:2239}; // class UpgradeTest
40
[email protected]5257bcf2013-02-19 05:47:1041base::FilePath UpgradeTest::next_mini_installer_path_;
[email protected]c744d292010-11-23 15:01:2242
43TEST_F(UpgradeTest, DoNothing) {
44}