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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |