Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: chrome/installer/test/upgrade_test.cc

Issue 6338020: Command-line tool to generate a newly versioned mini_installer.exe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Boilerplate for an upgrade scenario test. The mini_installer.exe residing in 5 // Boilerplate for an upgrade scenario test. The mini_installer.exe residing in
6 // the same directory as the host executable is re-versioned. 6 // the same directory as the host executable is re-versioned.
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "chrome/installer/test/alternate_version_generator.h" 11 #include "chrome/installer/test/alternate_version_generator.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace { 14 namespace {
15 const wchar_t kMiniInstallerExe[] = L"mini_installer.exe"; 15 const wchar_t kMiniInstallerExe[] = L"mini_installer.exe";
16 } // namespace 16 } // namespace
17 17
18 // Boilerplate for a future upgrade scenario test. 18 // Boilerplate for a future upgrade scenario test.
19 class UpgradeTest : public testing::Test { 19 class UpgradeTest : public testing::Test {
20 public: 20 public:
21 // Generate a newer version of mini_installer.exe. 21 // Generate a newer version of mini_installer.exe.
22 static void SetUpTestCase() { 22 static void SetUpTestCase() {
23 FilePath dir_exe; 23 FilePath dir_exe;
24 ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dir_exe)); 24 ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dir_exe));
25 ASSERT_TRUE(file_util::CreateTemporaryFile(&next_mini_installer_path_)); 25 ASSERT_TRUE(file_util::CreateTemporaryFile(&next_mini_installer_path_));
26 ASSERT_TRUE( 26 ASSERT_TRUE(
27 upgrade_test::GenerateNextVersion(dir_exe.Append(&kMiniInstallerExe[0]), 27 upgrade_test::GenerateAlternateVersion(
28 next_mini_installer_path_)); 28 dir_exe.Append(&kMiniInstallerExe[0]),
29 next_mini_installer_path_,
30 upgrade_test::NEXT_VERSION, NULL, NULL));
29 } 31 }
30 32
31 // Clean up by deleting the created newer version of mini_installer.exe. 33 // Clean up by deleting the created newer version of mini_installer.exe.
32 static void TearDownTestCase() { 34 static void TearDownTestCase() {
33 EXPECT_TRUE(file_util::Delete(next_mini_installer_path_, false)); 35 EXPECT_TRUE(file_util::Delete(next_mini_installer_path_, false));
34 } 36 }
35 private: 37 private:
36 static FilePath next_mini_installer_path_; 38 static FilePath next_mini_installer_path_;
37 }; // class UpgradeTest 39 }; // class UpgradeTest
38 40
39 FilePath UpgradeTest::next_mini_installer_path_; 41 FilePath UpgradeTest::next_mini_installer_path_;
40 42
41 TEST_F(UpgradeTest, DoNothing) { 43 TEST_F(UpgradeTest, DoNothing) {
42 } 44 }
OLDNEW
« no previous file with comments | « chrome/installer/test/alternate_version_generator_main.cc ('k') | chrome/installer/upgrade_test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698