Commit 56e97f99 authored by Istiaque Ahmed's avatar Istiaque Ahmed Committed by Commit Bot

Use ScopedWorkerBasedExtensionsChannel in some tests where it's needed.

ScopedWorkerBasedExtensionsChannel was introduced recently to centralize
worker's channel requirement for test. However, some tests are still
using manual channel override with ScopedCurrentChannel, this CL updates
them.

This makes moving SWs to different channel in future easier.

Bug: None
Change-Id: Iacc9faa2dbaf3569c0988893c1c542c19800e4f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1869016Reviewed-by: default avatarDavid Bertoni <dbertoni@chromium.org>
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708201}
parent 7fd6ae59
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "extensions/common/features/feature_channel.h" #include "extensions/common/scoped_worker_based_extensions_channel.h"
#include "extensions/test/result_catcher.h" #include "extensions/test/result_catcher.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
...@@ -134,8 +134,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContextMenus) { ...@@ -134,8 +134,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContextMenus) {
} }
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ServiceWorkerContextMenus) { IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ServiceWorkerContextMenus) {
// Service Workers are currently available only in Canary or trunk. ScopedWorkerBasedExtensionsChannel worker_channel_override;
ScopedCurrentChannel current_channel_override(version_info::Channel::UNKNOWN);
ASSERT_TRUE(RunExtensionTestWithFlags("context_menus/event_page", ASSERT_TRUE(RunExtensionTestWithFlags("context_menus/event_page",
kFlagRunAsServiceWorkerBasedExtension)) kFlagRunAsServiceWorkerBasedExtension))
<< message_; << message_;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "extensions/common/features/feature_session_type.h" #include "extensions/common/features/feature_session_type.h"
#include "extensions/common/manifest.h" #include "extensions/common/manifest.h"
#include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/scoped_worker_based_extensions_channel.h"
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
#include "extensions/common/value_builder.h" #include "extensions/common/value_builder.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -991,8 +992,7 @@ TEST(SimpleFeatureUnitTest, TestExperimentalExtensionApisSwitch) { ...@@ -991,8 +992,7 @@ TEST(SimpleFeatureUnitTest, TestExperimentalExtensionApisSwitch) {
} }
TEST(SimpleFeatureUnitTest, DisallowForServiceWorkers) { TEST(SimpleFeatureUnitTest, DisallowForServiceWorkers) {
// Service Worker features are only available on the trunk. ScopedWorkerBasedExtensionsChannel worker_channel_override;
ScopedCurrentChannel current_channel_override(version_info::Channel::UNKNOWN);
SimpleFeature feature; SimpleFeature feature;
feature.set_name("somefeature"); feature.set_name("somefeature");
......
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