summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/channels/test_call.html
blob: 49beaea4ff995694d4ef789967fc216795dcdfd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<meta charset="utf-8">
<title>call method</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/channel.sub.js"></script>

<script>
setup({single_test: true})
onload = async () => {
    let remote = await new RemoteGlobal();

    let url = `child_script.html?uuid=${remote.uuid}`;
    win = window.open(url, "_blank", "noopener");

    let result = await remote.call(async (elemId) => {
        return document.getElementById(elemId).textContent;
    }, ["test"]);
    assert_equals(result.trim(), "PASS");
    done();
}
</script>