summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/same-site-cookies/first-party.all.tentative.https.window.js
blob: d7e5f2ee42ca31d1e05ebfd68c7c1aefb75d411f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js

'use strict';

// Here's the set-up for this test:
// Step 1 (window) Set up listener for "DidStart" message and start worker.
// Step 2 (worker) Send "DidStart" message to window.
// Step 3 (window) Receive "DidStart" message and cleanup.

async_test(t => {
    // Step 1
    const worker = new SharedWorker("/workers/same-site-cookies/resources/worker.js", {sameSiteCookies: "all"});
    worker.port.onmessage = t.step_func(e => {
        // Step 3
        assert_equals(e.data, "DidStart", "Worker should have started");
        t.done();
    });
}, "Check SharedWorker sameSiteCookies option all for first-party");