OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |