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

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

Issue 1530002: Move history API out of experimental. Allow extensions to override history page. (Closed)
Patch Set: Rebase for commit. 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
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/page_transition_types.h » ('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) 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 extension->GetFullLaunchURL().spec()); 153 extension->GetFullLaunchURL().spec());
154 154
155 extension.reset(LoadAndExpectSuccess("launch_web_url_relative.json")); 155 extension.reset(LoadAndExpectSuccess("launch_web_url_relative.json"));
156 EXPECT_EQ(GURL("http://www.google.com/launch.html"), 156 EXPECT_EQ(GURL("http://www.google.com/launch.html"),
157 extension->GetFullLaunchURL()); 157 extension->GetFullLaunchURL());
158 158
159 extension.reset(LoadAndExpectSuccess("launch_web_url_absolute.json")); 159 extension.reset(LoadAndExpectSuccess("launch_web_url_absolute.json"));
160 EXPECT_EQ(GURL("http://www.google.com/launch.html"), 160 EXPECT_EQ(GURL("http://www.google.com/launch.html"),
161 extension->GetFullLaunchURL()); 161 extension->GetFullLaunchURL());
162 } 162 }
163
164 TEST_F(ManifestTest, Override) {
165 LoadAndExpectError("override_newtab_and_history.json",
166 errors::kMultipleOverrides);
167 LoadAndExpectError("override_invalid_page.json",
168 errors::kInvalidChromeURLOverrides);
169
170 scoped_ptr<Extension> extension;
171
172 extension.reset(LoadAndExpectSuccess("override_new_tab.json"));
173 EXPECT_EQ(extension->url().spec() + "newtab.html",
174 extension->GetChromeURLOverrides().find("newtab")->second.spec());
175
176 extension.reset(LoadAndExpectSuccess("override_history.json"));
177 EXPECT_EQ(extension->url().spec() + "history.html",
178 extension->GetChromeURLOverrides().find("history")->second.spec());
179
180 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/page_transition_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698