1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 add_task(async function test_explicit_object_prototype() {
10 "http://mochi.test:8888/browser/js/xpconnect/tests/browser/browser_promise_userInteractionHandling.html";
11 await BrowserTestUtils.withNewTab(url, async browser => {
12 await SpecialPowers.spawn(browser, [], async () => {
13 const DOMWindowUtils = EventUtils._getDOMWindowUtils(content.window);
15 DOMWindowUtils.isHandlingUserInput,
17 "not yet handling user input"
19 const button = content.document.getElementById("button");
22 const p = new Promise(r => {
26 button.addEventListener("click", () => {
27 is(DOMWindowUtils.isHandlingUserInput, true, "handling user input");
28 content.document.hasStorageAccess().then(() => {
30 DOMWindowUtils.isHandlingUserInput,
32 "still handling user input"
34 Promise.resolve().then(() => {
36 DOMWindowUtils.isHandlingUserInput,
38 "no more handling user input"
45 EventUtils.synthesizeMouseAtCenter(button, {}, content.window);