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

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

Issue 19547009: Move ".crx"/".pem" constants and extension_filenames constants into extensions/common/constants.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: todo Created 7 years, 5 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
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/file_util.h" 6 #include "base/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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 base::MessageLoopProxy::current(), 90 base::MessageLoopProxy::current(),
91 client_); 91 client_);
92 92
93 base::MessageLoopProxy::current()->PostTask( 93 base::MessageLoopProxy::current()->PostTask(
94 FROM_HERE, 94 FROM_HERE,
95 base::Bind(&SandboxedUnpacker::Start, sandboxed_unpacker_.get())); 95 base::Bind(&SandboxedUnpacker::Start, sandboxed_unpacker_.get()));
96 client_->WaitForUnpack(); 96 client_->WaitForUnpack();
97 } 97 }
98 98
99 base::FilePath GetInstallPath() { 99 base::FilePath GetInstallPath() {
100 return client_->temp_dir().AppendASCII( 100 return client_->temp_dir().AppendASCII(kTempExtensionName);
101 extension_filenames::kTempExtensionName);
102 } 101 }
103 102
104 protected: 103 protected:
105 base::ScopedTempDir extensions_dir_; 104 base::ScopedTempDir extensions_dir_;
106 MockSandboxedUnpackerClient* client_; 105 MockSandboxedUnpackerClient* client_;
107 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; 106 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_;
108 scoped_ptr<content::TestBrowserThreadBundle> browser_threads_; 107 scoped_ptr<content::TestBrowserThreadBundle> browser_threads_;
109 }; 108 };
110 109
111 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) { 110 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) {
112 SetupUnpacker("no_l10n.crx"); 111 SetupUnpacker("no_l10n.crx");
113 // Check that there is no _locales folder. 112 // Check that there is no _locales folder.
114 base::FilePath install_path = 113 base::FilePath install_path =
115 GetInstallPath().Append(kLocaleFolder); 114 GetInstallPath().Append(kLocaleFolder);
116 EXPECT_FALSE(base::PathExists(install_path)); 115 EXPECT_FALSE(base::PathExists(install_path));
117 } 116 }
118 117
119 TEST_F(SandboxedUnpackerTest, WithCatalogsSuccess) { 118 TEST_F(SandboxedUnpackerTest, WithCatalogsSuccess) {
120 SetupUnpacker("good_l10n.crx"); 119 SetupUnpacker("good_l10n.crx");
121 // Check that there is _locales folder. 120 // Check that there is _locales folder.
122 base::FilePath install_path = 121 base::FilePath install_path =
123 GetInstallPath().Append(kLocaleFolder); 122 GetInstallPath().Append(kLocaleFolder);
124 EXPECT_TRUE(base::PathExists(install_path)); 123 EXPECT_TRUE(base::PathExists(install_path));
125 } 124 }
126 125
127 } // namespace extensions 126 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698