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

Unified Diff: chrome/installer/test/upgrade_test.cc

Issue 5236002: Add infrastructure enabling tests of installer upgrade scenarios.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/test/upgrade_test.cc
===================================================================
--- chrome/installer/test/upgrade_test.cc (revision 0)
+++ chrome/installer/test/upgrade_test.cc (revision 0)
@@ -0,0 +1,42 @@
+// Copyright (c) 2010 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.
+
+// Boilerplate for an upgrade scenario test. The mini_installer.exe residing in
+// the same directory as the host executable is re-versioned.
+
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "chrome/installer/test/alternate_version_generator.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+ const wchar_t kMiniInstallerExe[] = L"mini_installer.exe";
+} // namespace
+
+// Boilerplate for a future upgrade scenario test.
+class UpgradeTest : public testing::Test {
+ public:
+ // Generate a newer version of mini_installer.exe.
+ static void SetUpTestCase() {
+ FilePath dir_exe;
+ ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dir_exe));
+ ASSERT_TRUE(file_util::CreateTemporaryFile(&next_mini_installer_path_));
+ ASSERT_TRUE(
+ upgrade_test::GenerateNextVersion(dir_exe.Append(&kMiniInstallerExe[0]),
+ next_mini_installer_path_));
+ }
+
+ // Clean up by deleting the created newer version of mini_installer.exe.
+ static void TearDownTestCase() {
+ EXPECT_TRUE(file_util::Delete(next_mini_installer_path_, false));
+ }
+ private:
+ static FilePath next_mini_installer_path_;
+}; // class UpgradeTest
+
+FilePath UpgradeTest::next_mini_installer_path_;
+
+TEST_F(UpgradeTest, DoNothing) {
+}
Property changes on: chrome\installer\test\upgrade_test.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698