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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <windows.h>
6
7 #include "base/file_path.h"
8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h"
10 #include "chrome/installer/mini_installer/decompress.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 class MiniDecompressTest : public testing::Test {
14 protected:
15 virtual void SetUp() {
16 }
17 virtual void TearDown() {
18 }
19 };
20
21 TEST_F(MiniDecompressTest, ExpandTest) {
amit 2011/03/15 20:54:35 cool test
tommi (sloooow) - chröme 2011/03/16 02:43:30 thanks :)
22 FilePath source_path;
23 PathService::Get(base::DIR_SOURCE_ROOT, &source_path);
24 source_path = source_path.Append(FILE_PATH_LITERAL("chrome"))
25 .Append(FILE_PATH_LITERAL("installer"))
26 .Append(FILE_PATH_LITERAL("test"))
27 .Append(FILE_PATH_LITERAL("data"))
28 .Append(FILE_PATH_LITERAL("SETUP.EX_"));
29
30 // Prepare a temp folder that will be automatically deleted along with
31 // our temporary test data.
32 ScopedTempDir temp_dir;
33 EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
34 FilePath dest_path(temp_dir.path().Append(FILE_PATH_LITERAL("setup.exe")));
35
36 // Decompress our test file.
37 EXPECT_TRUE(mini_installer::Expand(
38 const_cast<wchar_t*>(source_path.value().c_str()),
39 dest_path.value().c_str()));
40
41 // Check if the expanded file is a valid executable.
42 DWORD type = static_cast<DWORD>(-1);
43 EXPECT_TRUE(GetBinaryType(dest_path.value().c_str(), &type));
44 EXPECT_EQ(SCS_32BIT_BINARY, type);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698