OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 ASSERT_TRUE(false); | 50 ASSERT_TRUE(false); |
51 } | 51 } |
52 | 52 |
53 base::Closure quit_closure_; | 53 base::Closure quit_closure_; |
54 base::FilePath temp_dir_; | 54 base::FilePath temp_dir_; |
55 }; | 55 }; |
56 | 56 |
57 class SandboxedUnpackerTest : public testing::Test { | 57 class SandboxedUnpackerTest : public testing::Test { |
58 public: | 58 public: |
59 virtual void SetUp() { | 59 virtual void SetUp() { |
60 ASSERT_TRUE(extensions_dir_.CreateUniqueTempDir()); | 60 ASSERT_TRUE(extensions_dir_.CreateUniqueTempDir()); |
61 browser_threads_.reset(new content::TestBrowserThreadBundle( | 61 browser_threads_.reset(new content::TestBrowserThreadBundle( |
62 content::TestBrowserThreadBundle::IO_MAINLOOP)); | 62 content::TestBrowserThreadBundle::IO_MAINLOOP)); |
63 in_process_utility_thread_helper_.reset( | 63 in_process_utility_thread_helper_.reset( |
64 new content::InProcessUtilityThreadHelper); | 64 new content::InProcessUtilityThreadHelper); |
65 // It will delete itself. | 65 // It will delete itself. |
66 client_ = new MockSandboxedUnpackerClient; | 66 client_ = new MockSandboxedUnpackerClient; |
67 } | 67 } |
68 | 68 |
69 virtual void TearDown() { | 69 virtual void TearDown() { |
70 // Need to destruct SandboxedUnpacker before the message loop since | 70 // Need to destruct SandboxedUnpacker before the message loop since |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 TEST_F(SandboxedUnpackerTest, WithCatalogsSuccess) { | 119 TEST_F(SandboxedUnpackerTest, WithCatalogsSuccess) { |
120 SetupUnpacker("good_l10n.crx"); | 120 SetupUnpacker("good_l10n.crx"); |
121 // Check that there is _locales folder. | 121 // Check that there is _locales folder. |
122 base::FilePath install_path = | 122 base::FilePath install_path = |
123 GetInstallPath().Append(kLocaleFolder); | 123 GetInstallPath().Append(kLocaleFolder); |
124 EXPECT_TRUE(base::PathExists(install_path)); | 124 EXPECT_TRUE(base::PathExists(install_path)); |
125 } | 125 } |
126 | 126 |
| 127 TEST_F(SandboxedUnpackerTest, ZipFile) { |
| 128 SetupUnpacker("goodzip.zip"); |
| 129 } |
| 130 |
127 } // namespace extensions | 131 } // namespace extensions |
OLD | NEW |