Commit f4d9a36a authored by Nico Weber's avatar Nico Weber

Run browser_tests (and viz_browser_tests) on win/asan bot.

- PlatformAppBrowserTest.PictureInPicture consistently fails with a
  (apparently windows-only) use-after-free on win/asan. That code is new,
  so just revert it (see below), https://crbug.com/873234

- PDFExtensionHitTestTest.MouseLeave flakes fairly often on win/asan, so
  disable the test in that config, https://crbug.com/856169

- SaveType/SavePageOriginalVsSavedComparisonTest.ObjectElementsViaFile/0
  fails fairly consistenly on win/asan (and elsewhere) in
  network_service_browser_tests, so don't enable that suite on the win/asan
  bot just yet (https://crbug.com/840063).

Bug: 869973

Revert "Enable Picture-in-Picture for chrome apps."

This reverts commit e031e566.

Reason for revert: Test has a use-after-free, https://crbug.com/873234

Original change's description:
> Enable Picture-in-Picture for chrome apps.
>
> This CL enables Picture-in-Picture in chrome apps by implementing
> EnterPictureInPicture and ExitPictureInPicture in AppDelegate.
>
> Bug: 863309
> Change-Id: Ib35e83b03373abe864b3a0674ab1e0b341ce291b
> Reviewed-on: https://chromium-review.googlesource.com/1156513
> Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#580497}

TBR=beaufort.francois@gmail.com,rdevlin.cronin@chromium.org,jochen@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 863309
Change-Id: Ib6eda55a3b0889646c43ea3e7bfccdb590cea0b2
Reviewed-on: https://chromium-review.googlesource.com/1180763
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584347}
parent 66d74229
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "components/web_modal/web_contents_modal_dialog_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/host_zoom_map.h" #include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/picture_in_picture_window_controller.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
...@@ -1401,28 +1400,4 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, NewWindowAboutBlank) { ...@@ -1401,28 +1400,4 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, NewWindowAboutBlank) {
ASSERT_TRUE(RunPlatformAppTest("platform_apps/new_window_about_blank")); ASSERT_TRUE(RunPlatformAppTest("platform_apps/new_window_about_blank"));
} }
// Tests that platform apps can enter and exit Picture-in-Picture.
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, PictureInPicture) {
LoadAndLaunchPlatformApp("picture_in_picture", "Launched");
WebContents* web_contents = GetFirstAppWindowWebContents();
ASSERT_TRUE(web_contents);
content::PictureInPictureWindowController* window_controller =
content::PictureInPictureWindowController::GetOrCreateForWebContents(
web_contents);
ASSERT_TRUE(window_controller->GetWindowForTesting());
EXPECT_FALSE(window_controller->GetWindowForTesting()->IsVisible());
bool result = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
web_contents, "enterPictureInPicture();", &result));
EXPECT_TRUE(result);
EXPECT_TRUE(window_controller->GetWindowForTesting()->IsVisible());
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
web_contents, "exitPictureInPicture();", &result));
EXPECT_TRUE(result);
EXPECT_FALSE(window_controller->GetWindowForTesting()->IsVisible());
}
} // namespace extensions } // namespace extensions
...@@ -1777,7 +1777,13 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, CtrlWheelInvokesCustomZoom) { ...@@ -1777,7 +1777,13 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, CtrlWheelInvokesCustomZoom) {
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_P(PDFExtensionHitTestTest, MouseLeave) { #if defined(OS_WIN) && defined(ADDRESS_SANITIZER)
// https://crbug.com/856169
#define MAYBE_MouseLeave DISABLED_MouseLeave
#else
#define MAYBE_MouseLeave MouseLeave
#endif
IN_PROC_BROWSER_TEST_P(PDFExtensionHitTestTest, MAYBE_MouseLeave) {
GURL url = embedded_test_server()->GetURL("/pdf/pdf_embed.html"); GURL url = embedded_test_server()->GetURL("/pdf/pdf_embed.html");
// Load page with embedded PDF and make sure it succeeds. // Load page with embedded PDF and make sure it succeeds.
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "chrome/browser/favicon/favicon_utils.h" #include "chrome/browser/favicon/favicon_utils.h"
#include "chrome/browser/file_select_helper.h" #include "chrome/browser/file_select_helper.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/platform_util.h" #include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h" #include "chrome/browser/shell_integration.h"
...@@ -367,18 +366,6 @@ bool ChromeAppDelegate::TakeFocus(content::WebContents* web_contents, ...@@ -367,18 +366,6 @@ bool ChromeAppDelegate::TakeFocus(content::WebContents* web_contents,
#endif #endif
} }
gfx::Size ChromeAppDelegate::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
return PictureInPictureWindowManager::GetInstance()->EnterPictureInPicture(
web_contents, surface_id, natural_size);
}
void ChromeAppDelegate::ExitPictureInPicture() {
PictureInPictureWindowManager::GetInstance()->ExitPictureInPicture();
}
void ChromeAppDelegate::Observe(int type, void ChromeAppDelegate::Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
......
...@@ -74,10 +74,6 @@ class ChromeAppDelegate : public extensions::AppDelegate, ...@@ -74,10 +74,6 @@ class ChromeAppDelegate : public extensions::AppDelegate,
void OnHide() override; void OnHide() override;
void OnShow() override; void OnShow() override;
bool TakeFocus(content::WebContents* web_contents, bool reverse) override; bool TakeFocus(content::WebContents* web_contents, bool reverse) override;
gfx::Size EnterPictureInPicture(content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
void ExitPictureInPicture() override;
// content::NotificationObserver: // content::NotificationObserver:
void Observe(int type, void Observe(int type,
......
<!--
* Copyright 2018 The Chromium Authors. All rights reserved. Use of this
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
-->
<html>
<body>
<script src="main.js"></script>
</body>
</html>
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const video = document.createElement('video');
video.src = chrome.runtime.getURL('bear.webm');
video.load();
video.addEventListener('loadedmetadata', function() {
chrome.test.sendMessage('Launched');
});
function enterPictureInPicture() {
video.requestPictureInPicture()
.catch(error => { window.domAutomationController.send(false); });
video.addEventListener('enterpictureinpicture', function(pipWindow) {
window.domAutomationController.send(
pipWindow.width != 0 && pipWindow.height != 0);
}, { once: true });
}
function exitPictureInPicture() {
document.exitPictureInPicture()
.catch(error => { window.domAutomationController.send(false); });
video.addEventListener('leavepictureinpicture', function() {
window.domAutomationController.send(true);
}, { once: true });
}
{
"name": "Platform App Test: Picture-in-Picture",
"manifest_version": 2,
"version": "1",
"app": {
"background": {
"scripts": ["test.js"]
}
}
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('main.html', {}, function () {});
});
...@@ -25,10 +25,6 @@ class Rect; ...@@ -25,10 +25,6 @@ class Rect;
class Size; class Size;
} }
namespace viz {
class SurfaceId;
}
namespace extensions { namespace extensions {
class Extension; class Extension;
...@@ -93,17 +89,6 @@ class AppDelegate { ...@@ -93,17 +89,6 @@ class AppDelegate {
// a chance to handle the focus change. // a chance to handle the focus change.
// Return whether focus has been handled. // Return whether focus has been handled.
virtual bool TakeFocus(content::WebContents* web_contents, bool reverse) = 0; virtual bool TakeFocus(content::WebContents* web_contents, bool reverse) = 0;
// Notifies the Picture-in-Picture controller that there is a new player
// entering Picture-in-Picture.
// Returns the size of the Picture-in-Picture window.
virtual gfx::Size EnterPictureInPicture(content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) = 0;
// Updates the Picture-in-Picture controller with a signal that
// Picture-in-Picture mode has ended.
virtual void ExitPictureInPicture() = 0;
}; };
} // namespace extensions } // namespace extensions
......
...@@ -439,16 +439,6 @@ bool AppWindow::TakeFocus(WebContents* source, bool reverse) { ...@@ -439,16 +439,6 @@ bool AppWindow::TakeFocus(WebContents* source, bool reverse) {
return app_delegate_->TakeFocus(source, reverse); return app_delegate_->TakeFocus(source, reverse);
} }
gfx::Size AppWindow::EnterPictureInPicture(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
return app_delegate_->EnterPictureInPicture(web_contents(), surface_id,
natural_size);
}
void AppWindow::ExitPictureInPicture() {
app_delegate_->ExitPictureInPicture();
}
bool AppWindow::OnMessageReceived(const IPC::Message& message, bool AppWindow::OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
bool handled = true; bool handled = true;
......
...@@ -444,9 +444,6 @@ class AppWindow : public content::WebContentsDelegate, ...@@ -444,9 +444,6 @@ class AppWindow : public content::WebContentsDelegate,
content::RenderFrameHost* frame, content::RenderFrameHost* frame,
const content::BluetoothChooser::EventHandler& event_handler) override; const content::BluetoothChooser::EventHandler& event_handler) override;
bool TakeFocus(content::WebContents* source, bool reverse) override; bool TakeFocus(content::WebContents* source, bool reverse) override;
gfx::Size EnterPictureInPicture(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
void ExitPictureInPicture() override;
// content::WebContentsObserver implementation. // content::WebContentsObserver implementation.
bool OnMessageReceived(const IPC::Message& message, bool OnMessageReceived(const IPC::Message& message,
......
...@@ -106,16 +106,4 @@ bool ShellAppDelegate::TakeFocus(content::WebContents* web_contents, ...@@ -106,16 +106,4 @@ bool ShellAppDelegate::TakeFocus(content::WebContents* web_contents,
return false; return false;
} }
gfx::Size ShellAppDelegate::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
NOTREACHED();
return gfx::Size();
}
void ShellAppDelegate::ExitPictureInPicture() {
NOTREACHED();
}
} // namespace extensions } // namespace extensions
...@@ -52,10 +52,6 @@ class ShellAppDelegate : public AppDelegate { ...@@ -52,10 +52,6 @@ class ShellAppDelegate : public AppDelegate {
void OnHide() override {} void OnHide() override {}
void OnShow() override {} void OnShow() override {}
bool TakeFocus(content::WebContents* web_contents, bool reverse) override; bool TakeFocus(content::WebContents* web_contents, bool reverse) override;
gfx::Size EnterPictureInPicture(content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
void ExitPictureInPicture() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate); DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate);
......
...@@ -7536,6 +7536,34 @@ ...@@ -7536,6 +7536,34 @@
}, },
"test": "boringssl_ssl_tests" "test": "boringssl_ssl_tests"
}, },
{
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"os": "Windows-10-15063"
}
],
"shards": 10
},
"test": "browser_tests"
},
{
"args": [
"--enable-features=VizDisplayCompositor"
],
"name": "viz_browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"os": "Windows-10-15063"
}
],
"shards": 10
},
"test": "browser_tests"
},
{ {
"args": [ "args": [
"--enable-features=WebUIPolymer2", "--enable-features=WebUIPolymer2",
......
...@@ -285,7 +285,6 @@ ...@@ -285,7 +285,6 @@
# https://crbug.com/827327 # https://crbug.com/827327
-PictureInPictureWindowControllerBrowserTest.* -PictureInPictureWindowControllerBrowserTest.*
-ControlPictureInPictureWindowControllerBrowserTest.* -ControlPictureInPictureWindowControllerBrowserTest.*
-PlatformAppBrowserTest.PictureInPicture
# These started failing with the switch to ws2. # These started failing with the switch to ws2.
# https:://crbug.com/855767 # https:://crbug.com/855767
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
# chromium.memory # chromium.memory
'Linux TSan Tests', # https://crbug.com/368525 'Linux TSan Tests', # https://crbug.com/368525
'Mac ASan 64 Tests (1)', # https://crbug.com/828031 'Mac ASan 64 Tests (1)', # https://crbug.com/828031
'win-asan', # https://crbug.com/873234, https://crbug.com/856169
# chromium.win # chromium.win
'Win10 Tests x64 (dbg)', 'Win10 Tests x64 (dbg)',
], ],
...@@ -825,7 +824,7 @@ ...@@ -825,7 +824,7 @@
# chromium.memory # chromium.memory
'Linux ASan LSan Tests (1)', # No capacity, https://crbug.com/852442 'Linux ASan LSan Tests (1)', # No capacity, https://crbug.com/852442
'Linux TSan Tests', # No capacity, https://crbug.com/852442 'Linux TSan Tests', # No capacity, https://crbug.com/852442
'win-asan', # https://crbug.com/873234, https://crbug.com/856169 'win-asan', # https://crbug.com/840063
# chromium.win # chromium.win
'Win7 Tests (1)', # For swarming capacity reasons. 'Win7 Tests (1)', # For swarming capacity reasons.
'Win10 Tests x64 (dbg)', # Matches browser_tests. 'Win10 Tests x64 (dbg)', # Matches browser_tests.
...@@ -1325,7 +1324,6 @@ ...@@ -1325,7 +1324,6 @@
# chromium.memory # chromium.memory
'Linux TSan Tests', # https://crbug.com/368525 'Linux TSan Tests', # https://crbug.com/368525
'Mac ASan 64 Tests (1)', # https://crbug.com/828031 'Mac ASan 64 Tests (1)', # https://crbug.com/828031
'win-asan', # https://crbug.com/873234, https://crbug.com/856169
# chromium.win # chromium.win
# Currently too flaky on Windows. # Currently too flaky on Windows.
'Win 7 Tests x64 (1)', 'Win 7 Tests x64 (1)',
......
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