Commit 46fd8578 authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

Clean Picture-in-Picture tests

This CL make sure Picture-in-Picture tests don't enable
switches that are already enabled by default.

Change-Id: I288cd11a41b3eddb8a455a36f0165d6b0ec5ecb6
Reviewed-on: https://chromium-review.googlesource.com/1152818
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579361}
parent 5e33dcbe
......@@ -5,7 +5,6 @@
#include "content/public/browser/picture_in_picture_window_controller.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
......@@ -19,7 +18,6 @@
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "media/base/media_switches.h"
#include "net/dns/mock_host_resolver.h"
#if !defined(OS_ANDROID)
......@@ -31,16 +29,7 @@
class PictureInPictureWindowControllerBrowserTest
: public InProcessBrowserTest {
public:
PictureInPictureWindowControllerBrowserTest() {
feature_list_.InitWithFeatures(
{media::kPictureInPicture, media::kUseSurfaceLayerForVideo}, {});
}
void SetUpCommandLine(base::CommandLine* command_line) override {
InProcessBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
}
PictureInPictureWindowControllerBrowserTest() = default;
void SetUpOnMainThread() override {
host_resolver()->AddRule("*", "127.0.0.1");
......@@ -106,11 +95,20 @@ class PictureInPictureWindowControllerBrowserTest
private:
content::PictureInPictureWindowController* pip_window_controller_ = nullptr;
base::test::ScopedFeatureList feature_list_;
DISALLOW_COPY_AND_ASSIGN(PictureInPictureWindowControllerBrowserTest);
};
class ControlPictureInPictureWindowControllerBrowserTest
: public PictureInPictureWindowControllerBrowserTest {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
PictureInPictureWindowControllerBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
}
};
// Checks the creation of the window controller, as well as basic window
// creation and visibility.
IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest,
......@@ -213,7 +211,7 @@ IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest,
// Tests that when a custom control is clicked on a Picture-in-Picture window
// an event is sent to the caller.
IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest,
IN_PROC_BROWSER_TEST_F(ControlPictureInPictureWindowControllerBrowserTest,
PictureInPictureControlEventFired) {
GURL test_page_url = ui_test_utils::GetTestUrl(
base::FilePath(base::FilePath::kCurrentDirectory),
......
......@@ -1215,9 +1215,6 @@ IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) {
IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
ContextMenuForVideoNotInPictureInPicture) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(media::kPictureInPicture);
content::ContextMenuParams params;
params.media_type = blink::WebContextMenuData::kMediaTypeVideo;
params.media_flags |= blink::WebContextMenuData::kMediaCanPictureInPicture;
......@@ -1233,9 +1230,6 @@ IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
ContextMenuForVideoInPictureInPicture) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(media::kPictureInPicture);
content::ContextMenuParams params;
params.media_type = blink::WebContextMenuData::kMediaTypeVideo;
params.media_flags |= blink::WebContextMenuData::kMediaCanPictureInPicture;
......
......@@ -292,6 +292,7 @@
# disabled.
# https://crbug.com/827327
-PictureInPictureWindowControllerBrowserTest.*
-ControlPictureInPictureWindowControllerBrowserTest.*
# These started failing with the switch to ws2.
# https:://crbug.com/855767
......
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