| Index: chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
|
| diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
|
| index 2eef91d0ecefcdc38d39141d73724dde27e20b03..4e7da0478b912029bbdee78d43b35d21cf19883b 100644
|
| --- a/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
|
| +++ b/chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc
|
| @@ -2,24 +2,41 @@
|
| // 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_info.h"
|
| +#include "chrome/common/extensions/options_page_handler.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| +namespace keys = extension_manifest_keys;
|
| namespace errors = extension_manifest_errors;
|
|
|
| -TEST_F(ExtensionManifestTest, OptionsPageInApps) {
|
| +namespace {
|
| +
|
| +class OptionsPageManifestTest : public ExtensionManifestTest {
|
| + virtual void SetUp() OVERRIDE {
|
| + ExtensionManifestTest::SetUp();
|
| + extensions::ManifestHandler::Register(keys::kOptionsPage,
|
| + new extensions::OptionsPageHandler);
|
| + }
|
| +};
|
| +
|
| +TEST_F(OptionsPageManifestTest, OptionsPageInApps) {
|
| scoped_refptr<extensions::Extension> extension;
|
|
|
| // Allow options page with absolute URL in hosted apps.
|
| extension = LoadAndExpectSuccess("hosted_app_absolute_options.json");
|
| - EXPECT_STREQ("http",
|
| - extension->options_url().scheme().c_str());
|
| - EXPECT_STREQ("example.com",
|
| - extension->options_url().host().c_str());
|
| - EXPECT_STREQ("options.html",
|
| - extension->options_url().ExtractFileName().c_str());
|
| + EXPECT_STREQ(
|
| + "http",
|
| + extensions::ManifestURLInfo::GetOptionsPage(extension).scheme().c_str());
|
| + EXPECT_STREQ(
|
| + "example.com",
|
| + extensions::ManifestURLInfo::GetOptionsPage(extension).host().c_str());
|
| + EXPECT_STREQ(
|
| + "options.html",
|
| + extensions::ManifestURLInfo::
|
| + GetOptionsPage(extension).ExtractFileName().c_str());
|
|
|
| Testcase testcases[] = {
|
| // Forbid options page with relative URL in hosted apps.
|
| @@ -37,3 +54,5 @@ TEST_F(ExtensionManifestTest, OptionsPageInApps) {
|
| RunTestcases(testcases, arraysize(testcases),
|
| EXPECT_TYPE_ERROR);
|
| }
|
| +
|
| +} // namespace
|
|
|