1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 const EXAMPLE_COM_URL
= "https://example.com/browser/dom/midi/tests/";
5 const EXAMPLE_ORG_URL
= "https://example.org/browser/dom/midi/tests/";
6 const PAGE1
= "port_ids_page_1.html";
7 const PAGE2
= "port_ids_page_2.html";
9 // Return the MIDI port id of the first input port for the given URL and page
10 function id_for_tab(url
, page
) {
11 return BrowserTestUtils
.withNewTab(
17 async
function (browser
) {
18 return SpecialPowers
.spawn(browser
, [""], function () {
19 return content
.wrappedJSObject
.get_first_input_id();
25 add_task(async
function () {
31 [com_page1
, com_page1_reload
, org_page1
, org_page2
] = await Promise
.all([
32 id_for_tab(EXAMPLE_COM_URL
, PAGE1
),
33 id_for_tab(EXAMPLE_COM_URL
, PAGE1
),
34 id_for_tab(EXAMPLE_ORG_URL
, PAGE1
),
35 id_for_tab(EXAMPLE_ORG_URL
, PAGE2
),
40 "MIDI port ids should be the same when reloading the same page"
45 "MIDI port ids should be different in different origins"
50 "MIDI port ids should be the same in the same origin"