| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 public: | 42 public: |
| 43 virtual ~MockSandboxedExtensionUnpackerClient() {} | 43 virtual ~MockSandboxedExtensionUnpackerClient() {} |
| 44 | 44 |
| 45 MOCK_METHOD4(OnUnpackSuccess, | 45 MOCK_METHOD4(OnUnpackSuccess, |
| 46 void(const FilePath& temp_dir, | 46 void(const FilePath& temp_dir, |
| 47 const FilePath& extension_root, | 47 const FilePath& extension_root, |
| 48 const DictionaryValue* original_manifest, | 48 const DictionaryValue* original_manifest, |
| 49 const Extension* extension)); | 49 const Extension* extension)); |
| 50 | 50 |
| 51 MOCK_METHOD1(OnUnpackFailure, | 51 MOCK_METHOD1(OnUnpackFailure, |
| 52 void(const std::string& error)); | 52 void(const string16& error)); |
| 53 | 53 |
| 54 void DelegateToFake() { | 54 void DelegateToFake() { |
| 55 ON_CALL(*this, OnUnpackSuccess(_, _, _, _)) | 55 ON_CALL(*this, OnUnpackSuccess(_, _, _, _)) |
| 56 .WillByDefault(Invoke(::OnUnpackSuccess)); | 56 .WillByDefault(Invoke(::OnUnpackSuccess)); |
| 57 } | 57 } |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 class SandboxedExtensionUnpackerTest : public testing::Test { | 60 class SandboxedExtensionUnpackerTest : public testing::Test { |
| 61 public: | 61 public: |
| 62 virtual void SetUp() { | 62 virtual void SetUp() { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 OnUnpackSucceeded(); | 211 OnUnpackSucceeded(); |
| 212 | 212 |
| 213 // Check that there is newer _locales/en_US/messages.json file. | 213 // Check that there is newer _locales/en_US/messages.json file. |
| 214 base::PlatformFileInfo new_info; | 214 base::PlatformFileInfo new_info; |
| 215 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 215 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
| 216 | 216 |
| 217 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 217 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
| 218 | 218 |
| 219 ASSERT_TRUE(TempFilesRemoved()); | 219 ASSERT_TRUE(TempFilesRemoved()); |
| 220 } | 220 } |
| OLD | NEW |