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