Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js

Issue 2610243002: Import wpt@5e1a3b80cea8d36774d2afd78b29a74792e9f15a (Closed)
Patch Set: Rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js b/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js
index 6cd4020f6edf02caf2bfaa122690b0f6260cd670..cab23e35f9c8a9dc0339a5f3adc536fa7e361b58 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js
@@ -1,6 +1,6 @@
// Invokes callback from a trusted click event, to satisfy
// https://html.spec.whatwg.org/#triggered-by-user-activation
-function trusted_click(callback, container)
+function trusted_click(test, callback, container)
{
var document = container.ownerDocument;
var button = document.createElement("button");
@@ -8,17 +8,16 @@ function trusted_click(callback, container)
button.style.display = "block";
button.style.fontSize = "20px";
button.style.padding = "10px";
- button.onclick = function()
+ button.onclick = test.step_func(function()
{
callback();
container.removeChild(button);
- };
+ });
container.appendChild(button);
}
// Invokes element.requestFullscreen() from a trusted click.
-function trusted_request(element, container)
+function trusted_request(test, element, container)
{
- var request = element.requestFullscreen.bind(element);
- trusted_click(request, container || element.parentNode);
+ trusted_click(test, () => element.requestFullscreen(), container || element.parentNode);
}

Powered by Google App Engine
This is Rietveld 408576698