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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc

Issue 11660016: Move the parsing of "chrome_url_overrides" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch-rebased Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/manifest_url_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc
index b7d4c0ed8f643c7ca50e7fcf13c49239cd854523..9e4489d2e74d6519818e4010e7b418a6cf90b29a 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_override_unittest.cc
@@ -2,14 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
-
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_handler.h"
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
+#include "chrome/common/extensions/manifest_url_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extension_manifest_errors;
-TEST_F(ExtensionManifestTest, Override) {
+class URLOverridesManifestTest : public ExtensionManifestTest {
+ virtual void SetUp() OVERRIDE {
+ ExtensionManifestTest::SetUp();
+ extensions::ManifestHandler::Register(keys::kChromeURLOverrides,
+ new extensions::URLOverridesHandler);
+ }
+};
+
+TEST_F(URLOverridesManifestTest, Override) {
Testcase testcases[] = {
Testcase("override_newtab_and_history.json", errors::kMultipleOverrides),
Testcase("override_invalid_page.json", errors::kInvalidChromeURLOverrides)
@@ -21,9 +30,11 @@ TEST_F(ExtensionManifestTest, Override) {
extension = LoadAndExpectSuccess("override_new_tab.json");
EXPECT_EQ(extension->url().spec() + "newtab.html",
- extension->GetChromeURLOverrides().find("newtab")->second.spec());
+ extensions::URLOverrides::GetChromeURLOverrides(extension).
+ find("newtab")->second.spec());
extension = LoadAndExpectSuccess("override_history.json");
EXPECT_EQ(extension->url().spec() + "history.html",
- extension->GetChromeURLOverrides().find("history")->second.spec());
+ extensions::URLOverrides::GetChromeURLOverrides(extension).
+ find("history")->second.spec());
}
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/manifest_url_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698