This source file includes following definitions.
- TEST_F
#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
#include "chrome/common/extensions/manifest_url_handler.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extensions::manifest_errors;
class OptionsPageManifestTest : public ExtensionManifestTest {
};
TEST_F(OptionsPageManifestTest, OptionsPageInApps) {
scoped_refptr<extensions::Extension> extension;
extension = LoadAndExpectSuccess("hosted_app_absolute_options.json");
EXPECT_STREQ("http",
extensions::ManifestURL::GetOptionsPage(extension.get())
.scheme().c_str());
EXPECT_STREQ(
"example.com",
extensions::ManifestURL::GetOptionsPage(extension.get()).host().c_str());
EXPECT_STREQ("options.html",
extensions::ManifestURL::GetOptionsPage(extension.get())
.ExtractFileName().c_str());
extension = LoadAndExpectSuccess("platform_app_with_options_page.json");
EXPECT_TRUE(extensions::ManifestURL::GetOptionsPage(extension.get())
.is_empty());
Testcase testcases[] = {
Testcase("hosted_app_relative_options.json",
errors::kInvalidOptionsPageInHostedApp),
Testcase("hosted_app_file_options.json",
errors::kInvalidOptionsPageInHostedApp),
Testcase("packaged_app_absolute_options.json",
errors::kInvalidOptionsPageExpectUrlInPackage)
};
RunTestcases(testcases, arraysize(testcases),
EXPECT_TYPE_ERROR);
}