Revision ecd2c46c1a10a0c39dd83bcbe2fec5ece4fb6e26 authored by Ovidio Henriquez on 15 March 2018, 20:28:05 UTC, committed by Philip Jägenstedt on 17 March 2018, 02:11:13 UTC
This change adds a new FakeBluetoothChooser interface stub to expand on.
The design for this class is detailed in the following document:
https://docs.google.com/document/d/1XFl_4ZAgO8ddM6U53A9AfUuZeWgJnlYD5wtbXqEpzeg

BUG=719827

Change-Id: I34169ce62dd5b35796639b7643d899b8315cc4c7
Reviewed-on: https://chromium-review.googlesource.com/909726
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Conley Owens <cco3@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543479}
1 parent 53ea2c3
Raw File
trusted-click.js
// Invokes callback from a trusted click event, to satisfy
// https://html.spec.whatwg.org/#triggered-by-user-activation
function trusted_click(test, callback, container)
{
    var document = container.ownerDocument;
    var button = document.createElement("button");
    button.textContent = "click to continue test";
    button.style.display = "block";
    button.style.fontSize = "20px";
    button.style.padding = "10px";
    button.onclick = test.step_func(function()
    {
        callback();
        container.removeChild(button);
    });
    container.appendChild(button);
}

// Invokes element.requestFullscreen() from a trusted click.
function trusted_request(test, element, container)
{
    trusted_click(test, () => element.requestFullscreen(), container || element.parentNode);
}
back to top