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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 &loop_)); | 68 &loop_)); |
69 // It will delete itself. | 69 // It will delete itself. |
70 client_ = new MockSandboxedUnpackerClient; | 70 client_ = new MockSandboxedUnpackerClient; |
71 client_->DelegateToFake(); | 71 client_->DelegateToFake(); |
72 } | 72 } |
73 | 73 |
74 virtual void TearDown() { | 74 virtual void TearDown() { |
75 // Need to destruct SandboxedUnpacker before the message loop since | 75 // Need to destruct SandboxedUnpacker before the message loop since |
76 // it posts a task to it. | 76 // it posts a task to it. |
77 sandboxed_unpacker_ = NULL; | 77 sandboxed_unpacker_ = NULL; |
78 loop_.RunAllPending(); | 78 loop_.RunUntilIdle(); |
79 } | 79 } |
80 | 80 |
81 void SetupUnpacker(const std::string& crx_name) { | 81 void SetupUnpacker(const std::string& crx_name) { |
82 FilePath original_path; | 82 FilePath original_path; |
83 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &original_path)); | 83 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &original_path)); |
84 original_path = original_path.AppendASCII("extensions") | 84 original_path = original_path.AppendASCII("extensions") |
85 .AppendASCII("unpacker") | 85 .AppendASCII("unpacker") |
86 .AppendASCII(crx_name); | 86 .AppendASCII(crx_name); |
87 ASSERT_TRUE(file_util::PathExists(original_path)) << original_path.value(); | 87 ASSERT_TRUE(file_util::PathExists(original_path)) << original_path.value(); |
88 | 88 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // Check that there is newer _locales/en_US/messages.json file. | 215 // Check that there is newer _locales/en_US/messages.json file. |
216 base::PlatformFileInfo new_info; | 216 base::PlatformFileInfo new_info; |
217 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 217 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
218 | 218 |
219 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 219 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
220 | 220 |
221 ASSERT_TRUE(TempFilesRemoved()); | 221 ASSERT_TRUE(TempFilesRemoved()); |
222 } | 222 } |
223 | 223 |
224 } // namespace extensions | 224 } // namespace extensions |
OLD | NEW |