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

Unified Diff: chrome/installer/mini_installer/decompress_test.cc

Issue 6693015: Switch out the setup api for using the cabinet API directly.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mini_installer/decompress.cc ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/decompress_test.cc
===================================================================
--- chrome/installer/mini_installer/decompress_test.cc (revision 0)
+++ chrome/installer/mini_installer/decompress_test.cc (revision 0)
@@ -0,0 +1,44 @@
+// 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.
+
+#include <windows.h>
+
+#include "base/file_path.h"
+#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
+#include "chrome/installer/mini_installer/decompress.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class MiniDecompressTest : public testing::Test {
M-A Ruel 2011/06/24 12:40:22 Please do not use empty fixture class! Someone on
+ protected:
+ virtual void SetUp() {
+ }
+ virtual void TearDown() {
+ }
+};
+
+TEST_F(MiniDecompressTest, ExpandTest) {
+ FilePath source_path;
+ PathService::Get(base::DIR_SOURCE_ROOT, &source_path);
+ source_path = source_path.Append(FILE_PATH_LITERAL("chrome"))
+ .Append(FILE_PATH_LITERAL("installer"))
+ .Append(FILE_PATH_LITERAL("test"))
+ .Append(FILE_PATH_LITERAL("data"))
+ .Append(FILE_PATH_LITERAL("SETUP.EX_"));
+
+ // Prepare a temp folder that will be automatically deleted along with
+ // our temporary test data.
+ ScopedTempDir temp_dir;
+ EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
+ FilePath dest_path(temp_dir.path().Append(FILE_PATH_LITERAL("setup.exe")));
+
+ // Decompress our test file.
+ EXPECT_TRUE(mini_installer::Expand(source_path.value().c_str(),
+ dest_path.value().c_str()));
+
+ // Check if the expanded file is a valid executable.
+ DWORD type = static_cast<DWORD>(-1);
+ EXPECT_TRUE(GetBinaryType(dest_path.value().c_str(), &type));
+ EXPECT_EQ(SCS_32BIT_BINARY, type);
+}
Property changes on: chrome\installer\mini_installer\decompress_test.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/installer/mini_installer/decompress.cc ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698