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

Side by Side Diff: chrome/common/extensions/extension_manifests_unittest.cc

Issue 2824005: Reenable InstallApps attempt #2. This time with a fix to (Closed)
Patch Set: Created 10 years, 6 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
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 26 matching lines...) Expand all
37 EXPECT_TRUE(file_util::PathExists(path)); 37 EXPECT_TRUE(file_util::PathExists(path));
38 38
39 JSONFileValueSerializer serializer(path); 39 JSONFileValueSerializer serializer(path);
40 scoped_ptr<DictionaryValue> value( 40 scoped_ptr<DictionaryValue> value(
41 static_cast<DictionaryValue*>(serializer.Deserialize(NULL, error))); 41 static_cast<DictionaryValue*>(serializer.Deserialize(NULL, error)));
42 if (!value.get()) 42 if (!value.get())
43 return NULL; 43 return NULL;
44 44
45 scoped_ptr<Extension> extension(new Extension(path.DirName())); 45 scoped_ptr<Extension> extension(new Extension(path.DirName()));
46 extension->set_location(location); 46 extension->set_location(location);
47 if (enable_apps_) 47 extension->set_apps_enabled(enable_apps_);
48 extension->set_apps_enabled(true);
49 48
50 if (!extension->InitFromValue(*value, false, error)) 49 if (!extension->InitFromValue(*value, false, error))
51 return NULL; 50 return NULL;
52 51
53 return extension.release(); 52 return extension.release();
54 } 53 }
55 54
56 Extension* LoadAndExpectSuccess(const std::string& name) { 55 Extension* LoadAndExpectSuccess(const std::string& name) {
57 std::string error; 56 std::string error;
58 Extension* extension = LoadExtension(name, &error); 57 Extension* extension = LoadExtension(name, &error);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 "permission_chrome_resources_url.json", 212 "permission_chrome_resources_url.json",
214 Extension::COMPONENT, 213 Extension::COMPONENT,
215 &error)); 214 &error));
216 EXPECT_EQ("", error); 215 EXPECT_EQ("", error);
217 } 216 }
218 217
219 TEST_F(ManifestTest, ChromeURLContentScriptInvalid) { 218 TEST_F(ManifestTest, ChromeURLContentScriptInvalid) {
220 LoadAndExpectError("content_script_chrome_url_invalid.json", 219 LoadAndExpectError("content_script_chrome_url_invalid.json",
221 errors::kInvalidMatch); 220 errors::kInvalidMatch);
222 } 221 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698