 triggerMQLEvent(mql);
    await waitForChangesReported();
    assert_equals(calls, 1);
}, "onchange removes listener");

promise_test(async t => {
    const mql = await createMQL(t);

    let calls = 0;
    mql.addEventListener("change", {
        handleEvent() {
            calls++;
        },
    });

    triggerMQLEvent(mql);
    await waitForChangesReported();
    assert_equals(calls, 1);
}, 'listeners for "change" type are called');

promise_test(async t => {
    const mql = await createMQL(t);
    mq