Commit 97603850 authored by David Bertoni's avatar David Bertoni Committed by Commit Bot

[Extensions] Enable Service Worker-based extensions in Stable.

Bug: 1133034
Change-Id: Iec185526bfa222e601252d9a0e1e7cedde2988cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437307Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813409}
parent 3c2bd024
......@@ -2490,24 +2490,12 @@ IN_PROC_BROWSER_TEST_P(ServiceWorkerCheckBindingsTest, BindingsAvailability) {
ExtensionTestMessageListener result_listener("SUCCESS", false);
result_listener.set_failure_message("FAILURE");
// The extension will only load properly if Service Worker-based extensions
// are supported in the channel being tested.
bool expect_failure =
GetParam() > extension_misc::kMinChannelForServiceWorkerBasedExtension;
int flags = kFlagEnableFileAccess;
if (expect_failure)
flags |= kFlagIgnoreManifestWarnings;
scoped_refptr<const Extension> extension =
LoadExtensionWithFlags(test_dir.UnpackedPath(), flags);
LoadExtension(test_dir.UnpackedPath());
ASSERT_TRUE(extension.get());
if (expect_failure) {
EXPECT_FALSE(BackgroundInfo::IsServiceWorkerBased(extension.get()));
} else {
EXPECT_TRUE(BackgroundInfo::IsServiceWorkerBased(extension.get()));
EXPECT_TRUE(result_listener.WaitUntilSatisfied());
}
EXPECT_TRUE(BackgroundInfo::IsServiceWorkerBased(extension.get()));
EXPECT_TRUE(result_listener.WaitUntilSatisfied());
}
INSTANTIATE_TEST_SUITE_P(Unknown,
......
......@@ -170,12 +170,15 @@ TEST_F(ExtensionManifestBackgroundTest, ServiceWorkerBasedBackgroundKey) {
// - specifying a non-existent file.
// - specifying multiple files.
// - specifying invalid type (non-string) values.
{
ScopedCurrentChannel stable(version_info::Channel::STABLE);
scoped_refptr<Extension> extension =
LoadAndExpectSuccess("service_worker_based_background.json");
}
{
ScopedCurrentChannel beta(version_info::Channel::BETA);
scoped_refptr<Extension> extension =
LoadAndExpectWarning("service_worker_based_background.json",
"'background.service_worker' requires dev "
"channel or newer, but this is the beta channel.");
LoadAndExpectSuccess("service_worker_based_background.json");
}
{
ScopedCurrentChannel dev(version_info::Channel::DEV);
......
......@@ -56,7 +56,7 @@
"min_manifest_version": 2
},
"background.service_worker": {
"channel": "dev",
"channel": "stable",
"extension_types": ["extension"],
"min_manifest_version": 2
},
......
......@@ -293,7 +293,7 @@ extern const logging::LogSeverity kMinimumSeverityToReportError;
// The minimum channel where Service Worker based extensions can run.
constexpr version_info::Channel kMinChannelForServiceWorkerBasedExtension =
version_info::Channel::DEV;
version_info::Channel::STABLE;
// IDs for the Media Router Component Extension.
extern const char kCastExtensionIdRelease[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment