| 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/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::FilePath GetInstallPath() { | 124 base::FilePath GetInstallPath() { |
| 125 return client_->temp_dir().AppendASCII(kTempExtensionName); | 125 return client_->temp_dir().AppendASCII(kTempExtensionName); |
| 126 } | 126 } |
| 127 | 127 |
| 128 base::string16 GetInstallError() { return client_->unpack_err(); } | 128 base::string16 GetInstallError() { return client_->unpack_err(); } |
| 129 | 129 |
| 130 protected: | 130 protected: |
| 131 base::ScopedTempDir extensions_dir_; | 131 base::ScopedTempDir extensions_dir_; |
| 132 MockSandboxedUnpackerClient* client_; | 132 MockSandboxedUnpackerClient* client_; |
| 133 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; | 133 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; |
| 134 scoped_ptr<content::TestBrowserThreadBundle> browser_threads_; | 134 std::unique_ptr<content::TestBrowserThreadBundle> browser_threads_; |
| 135 scoped_ptr<content::InProcessUtilityThreadHelper> | 135 std::unique_ptr<content::InProcessUtilityThreadHelper> |
| 136 in_process_utility_thread_helper_; | 136 in_process_utility_thread_helper_; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) { | 139 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) { |
| 140 SetupUnpacker("no_l10n.crx", ""); | 140 SetupUnpacker("no_l10n.crx", ""); |
| 141 // Check that there is no _locales folder. | 141 // Check that there is no _locales folder. |
| 142 base::FilePath install_path = GetInstallPath().Append(kLocaleFolder); | 142 base::FilePath install_path = GetInstallPath().Append(kLocaleFolder); |
| 143 EXPECT_FALSE(base::PathExists(install_path)); | 143 EXPECT_FALSE(base::PathExists(install_path)); |
| 144 } | 144 } |
| 145 | 145 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 EXPECT_EQ(base::string16(), GetInstallError()); | 182 EXPECT_EQ(base::string16(), GetInstallError()); |
| 183 } | 183 } |
| 184 | 184 |
| 185 TEST_F(SandboxedUnpackerTest, SkipHashCheck) { | 185 TEST_F(SandboxedUnpackerTest, SkipHashCheck) { |
| 186 SetupUnpacker("good_l10n.crx", "badhash"); | 186 SetupUnpacker("good_l10n.crx", "badhash"); |
| 187 // Check that there is no error message. | 187 // Check that there is no error message. |
| 188 EXPECT_EQ(base::string16(), GetInstallError()); | 188 EXPECT_EQ(base::string16(), GetInstallError()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace extensions | 191 } // namespace extensions |
| OLD | NEW |