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

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

Issue 1120006: detect preferences errors (Closed)
Patch Set: changes from review Created 10 years, 8 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
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 "chrome/common/chrome_paths.h" 9 #include "chrome/common/chrome_paths.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 13 matching lines...) Expand all
24 std::string* error) { 24 std::string* error) {
25 FilePath path; 25 FilePath path;
26 PathService::Get(chrome::DIR_TEST_DATA, &path); 26 PathService::Get(chrome::DIR_TEST_DATA, &path);
27 path = path.AppendASCII("extensions") 27 path = path.AppendASCII("extensions")
28 .AppendASCII("manifest_tests") 28 .AppendASCII("manifest_tests")
29 .AppendASCII(name.c_str()); 29 .AppendASCII(name.c_str());
30 EXPECT_TRUE(file_util::PathExists(path)); 30 EXPECT_TRUE(file_util::PathExists(path));
31 31
32 JSONFileValueSerializer serializer(path); 32 JSONFileValueSerializer serializer(path);
33 scoped_ptr<DictionaryValue> value( 33 scoped_ptr<DictionaryValue> value(
34 static_cast<DictionaryValue*>(serializer.Deserialize(error))); 34 static_cast<DictionaryValue*>(serializer.Deserialize(NULL, error)));
35 if (!value.get()) 35 if (!value.get())
36 return NULL; 36 return NULL;
37 37
38 scoped_ptr<Extension> extension(new Extension(path.DirName())); 38 scoped_ptr<Extension> extension(new Extension(path.DirName()));
39 if (enable_apps_) 39 if (enable_apps_)
40 extension->set_apps_enabled(true); 40 extension->set_apps_enabled(true);
41 41
42 if (!extension->InitFromValue(*value, false, error)) 42 if (!extension->InitFromValue(*value, false, error))
43 return NULL; 43 return NULL;
44 44
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 extension.reset(LoadAndExpectSuccess("override_new_tab.json")); 172 extension.reset(LoadAndExpectSuccess("override_new_tab.json"));
173 EXPECT_EQ(extension->url().spec() + "newtab.html", 173 EXPECT_EQ(extension->url().spec() + "newtab.html",
174 extension->GetChromeURLOverrides().find("newtab")->second.spec()); 174 extension->GetChromeURLOverrides().find("newtab")->second.spec());
175 175
176 extension.reset(LoadAndExpectSuccess("override_history.json")); 176 extension.reset(LoadAndExpectSuccess("override_history.json"));
177 EXPECT_EQ(extension->url().spec() + "history.html", 177 EXPECT_EQ(extension->url().spec() + "history.html",
178 extension->GetChromeURLOverrides().find("history")->second.spec()); 178 extension->GetChromeURLOverrides().find("history")->second.spec());
179 179
180 } 180 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698