t _event;
    mql.onchange = event => {
        _event = event;
    };

    triggerMQLEvent(mql);
    await waitForChangesReported();
    assert_equals(_event.media, mql.media);
    assert_equals(_event.matches, mql.matches);
}, "onchange adds listener");

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

    let calls = 0;
    mql.onchange = () => {
        calls++;
    };

    triggerMQLEvent(mql);
    await waitForChangesReported();
    assert_equals(calls, 1);

    mql.onchange = null;

   