OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" | 5 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 void TestCallback(bool* out_success, const base::Closure& quit, bool success) { | 24 void TestCallback(bool* out_success, const base::Closure& quit, bool success) { |
25 *out_success = success; | 25 *out_success = success; |
26 quit.Run(); | 26 quit.Run(); |
27 } | 27 } |
28 | 28 |
29 class ZipFileCreatorTest : public InProcessBrowserTest { | 29 class ZipFileCreatorTest : public InProcessBrowserTest { |
30 protected: | 30 protected: |
31 virtual void SetUpOnMainThread() OVERRIDE { | 31 virtual void SetUpOnMainThread() override { |
32 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 32 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
33 ASSERT_TRUE(base::CreateDirectory(zip_base_dir())); | 33 ASSERT_TRUE(base::CreateDirectory(zip_base_dir())); |
34 } | 34 } |
35 | 35 |
36 base::FilePath zip_archive_path() const { | 36 base::FilePath zip_archive_path() const { |
37 return dir_.path().AppendASCII("test.zip"); | 37 return dir_.path().AppendASCII("test.zip"); |
38 } | 38 } |
39 | 39 |
40 base::FilePath zip_base_dir() const { | 40 base::FilePath zip_base_dir() const { |
41 return dir_.path().AppendASCII("files"); | 41 return dir_.path().AppendASCII("files"); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 EXPECT_TRUE(reader.ExtractCurrentEntryToFilePath(out)); | 114 EXPECT_TRUE(reader.ExtractCurrentEntryToFilePath(out)); |
115 EXPECT_TRUE(base::ContentsEqual(zip_base_dir().Append(kFile2), out)); | 115 EXPECT_TRUE(base::ContentsEqual(zip_base_dir().Append(kFile2), out)); |
116 } else { | 116 } else { |
117 ADD_FAILURE(); | 117 ADD_FAILURE(); |
118 } | 118 } |
119 ASSERT_TRUE(reader.AdvanceToNextEntry()); | 119 ASSERT_TRUE(reader.AdvanceToNextEntry()); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 } // namespace file_manager | 123 } // namespace file_manager |
OLD | NEW |