| Index: chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
|
| diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
|
| index 59836afebfa2ca74f3ba227d12df7dda6f03190f..8317002a895e33429d9cca3f5cb7b37a3d97e061 100644
|
| --- a/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
|
| +++ b/chrome/common/extensions/manifest_tests/extension_manifests_homepage_unittest.cc
|
| @@ -2,16 +2,25 @@
|
| // 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.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"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| namespace errors = extension_manifest_errors;
|
|
|
| -TEST_F(ExtensionManifestTest, ParseHomepageURLs) {
|
| +class HomepageURLManifestTest : public ExtensionManifestTest {
|
| + virtual void SetUp() OVERRIDE {
|
| + ExtensionManifestTest::SetUp();
|
| + extensions::ManifestHandler::Register(extension_manifest_keys::kHomepageURL,
|
| + new extensions::HomepageURLHandler);
|
| + }
|
| +};
|
| +
|
| +TEST_F(HomepageURLManifestTest, ParseHomepageURLs) {
|
| scoped_refptr<extensions::Extension> extension(
|
| LoadAndExpectSuccess("homepage_valid.json"));
|
|
|
| @@ -27,18 +36,19 @@ TEST_F(ExtensionManifestTest, ParseHomepageURLs) {
|
| EXPECT_TYPE_ERROR);
|
| }
|
|
|
| -TEST_F(ExtensionManifestTest, GetHomepageURL) {
|
| +TEST_F(HomepageURLManifestTest, GetHomepageURL) {
|
| scoped_refptr<extensions::Extension> extension(
|
| LoadAndExpectSuccess("homepage_valid.json"));
|
| - EXPECT_EQ(GURL("http://foo.com#bar"), extension->GetHomepageURL());
|
| + EXPECT_EQ(GURL("http://foo.com#bar"),
|
| + extensions::ManifestURL::GetHomepageURL(extension));
|
|
|
| // The Google Gallery URL ends with the id, which depends on the path, which
|
| // can be different in testing, so we just check the part before id.
|
| extension = LoadAndExpectSuccess("homepage_google_hosted.json");
|
| - EXPECT_TRUE(StartsWithASCII(extension->GetHomepageURL().spec(),
|
| - "https://chrome.google.com/webstore/detail/",
|
| - false));
|
| + EXPECT_TRUE(StartsWithASCII(
|
| + extensions::ManifestURL::GetHomepageURL(extension).spec(),
|
| + "https://chrome.google.com/webstore/detail/", false));
|
|
|
| extension = LoadAndExpectSuccess("homepage_externally_hosted.json");
|
| - EXPECT_EQ(GURL(), extension->GetHomepageURL());
|
| + EXPECT_EQ(GURL(), extensions::ManifestURL::GetHomepageURL(extension));
|
| }
|
|
|