Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 unpacker_.reset(new ExtensionUnpacker( 94 unpacker_.reset(new ExtensionUnpacker(
95 crx_path, Extension::INTERNAL, Extension::NO_FLAGS)); 95 crx_path, Extension::INTERNAL, Extension::NO_FLAGS));
96 96
97 // Build a temp area where the extension will be unpacked. 97 // Build a temp area where the extension will be unpacked.
98 temp_path_ = 98 temp_path_ =
99 temp_dir_.path().AppendASCII("sandboxed_extension_unpacker_test_Temp"); 99 temp_dir_.path().AppendASCII("sandboxed_extension_unpacker_test_Temp");
100 ASSERT_TRUE(file_util::CreateDirectory(temp_path_)); 100 ASSERT_TRUE(file_util::CreateDirectory(temp_path_));
101 101
102 sandboxed_unpacker_ = 102 sandboxed_unpacker_ =
103 new SandboxedExtensionUnpacker(crx_path, NULL, Extension::INTERNAL, 103 new SandboxedExtensionUnpacker(crx_path, Extension::INTERNAL,
104 Extension::NO_FLAGS, client_); 104 Extension::NO_FLAGS, client_);
105 sandboxed_unpacker_->set_use_utility_process(true);
105 106
106 // Hack since SandboxedExtensionUnpacker gets its background thread id from 107 // Hack since SandboxedExtensionUnpacker gets its background thread id from
107 // the Start call, but we don't call it here. 108 // the Start call, but we don't call it here.
108 sandboxed_unpacker_->thread_identifier_ = BrowserThread::FILE; 109 sandboxed_unpacker_->thread_identifier_ = BrowserThread::FILE;
109 EXPECT_TRUE(PrepareUnpackerEnv()); 110 EXPECT_TRUE(PrepareUnpackerEnv());
110 } 111 }
111 112
112 bool PrepareUnpackerEnv() { 113 bool PrepareUnpackerEnv() {
113 sandboxed_unpacker_->extension_root_ = 114 sandboxed_unpacker_->extension_root_ =
114 temp_dir_.path().AppendASCII(extension_filenames::kTempExtensionName); 115 temp_dir_.path().AppendASCII(extension_filenames::kTempExtensionName);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 OnUnpackSucceeded(); 212 OnUnpackSucceeded();
212 213
213 // Check that there is newer _locales/en_US/messages.json file. 214 // Check that there is newer _locales/en_US/messages.json file.
214 base::PlatformFileInfo new_info; 215 base::PlatformFileInfo new_info;
215 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); 216 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info));
216 217
217 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); 218 EXPECT_TRUE(new_info.last_modified > old_info.last_modified);
218 219
219 ASSERT_TRUE(TempFilesRemoved()); 220 ASSERT_TRUE(TempFilesRemoved());
220 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698