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/files/file_util.h" | 6 #include "base/files/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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 base::FilePath temp_dir() const { return temp_dir_; } | 34 base::FilePath temp_dir() const { return temp_dir_; } |
35 | 35 |
36 private: | 36 private: |
37 virtual ~MockSandboxedUnpackerClient() {} | 37 virtual ~MockSandboxedUnpackerClient() {} |
38 | 38 |
39 virtual void OnUnpackSuccess(const base::FilePath& temp_dir, | 39 virtual void OnUnpackSuccess(const base::FilePath& temp_dir, |
40 const base::FilePath& extension_root, | 40 const base::FilePath& extension_root, |
41 const base::DictionaryValue* original_manifest, | 41 const base::DictionaryValue* original_manifest, |
42 const Extension* extension, | 42 const Extension* extension, |
43 const SkBitmap& install_icon) OVERRIDE { | 43 const SkBitmap& install_icon) override { |
44 temp_dir_ = temp_dir; | 44 temp_dir_ = temp_dir; |
45 quit_closure_.Run(); | 45 quit_closure_.Run(); |
46 | 46 |
47 } | 47 } |
48 | 48 |
49 virtual void OnUnpackFailure(const base::string16& error) OVERRIDE { | 49 virtual void OnUnpackFailure(const base::string16& error) override { |
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() { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } // namespace extensions | 127 } // namespace extensions |
OLD | NEW |