Move manifest_url_handler to //extensions
[chromium-blink-merge.git] / chrome / common / extensions / manifest_tests / extension_manifests_about_unittest.cc
blob3430164578e4cf8ab1175fe6d340af70b9b41eef
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
6 #include "extensions/common/manifest_constants.h"
7 #include "extensions/common/manifest_url_handlers.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 namespace errors = extensions::manifest_errors;
12 class AboutPageManifestTest : public ChromeManifestTest {};
14 TEST_F(AboutPageManifestTest, AboutPageInSharedModules) {
15 scoped_refptr<extensions::Extension> extension;
16 extension = LoadAndExpectSuccess("shared_module_about.json");
17 EXPECT_EQ(GURL("chrome-extension://" + extension->id() + "/about.html"),
18 extensions::ManifestURL::GetAboutPage(extension.get()));
20 Testcase testcases[] = {
21 // Forbid data types other than strings.
22 Testcase("shared_module_about_invalid_type.json",
23 errors::kInvalidAboutPage),
25 // Forbid absolute URLs.
26 Testcase("shared_module_about_absolute.json",
27 errors::kInvalidAboutPageExpectRelativePath)};
28 RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_ERROR);