Revision 976e2c1f4b37821272f303aee639b62e1fd085f9 authored by Ian Kilpatrick on 12 April 2018, 12:08:38 UTC, committed by Blink WPT Bot on 12 April 2018, 12:27:52 UTC
There are probably larger changes that need to happen to ensure that
the custom-layout and multicol play nicely together, but this removes
a DCHECK crash for now.

Bug: 823074
Change-Id: I98f4a34bd0c35e8cd3d23501ca64f38b96be9e7d
Reviewed-on: https://chromium-review.googlesource.com/990780
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550148}
1 parent 19a42b9
Raw File
shared-worker-name-via-options.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test the name property of shared workers mixing constructor options and constructor strings</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-workerglobalscope-name">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-sharedworker">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-sharedworkerglobalscope-name">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>
"use strict";

const name = "my name";

const worker1 = new SharedWorker("support/shared-name.js", { name });
worker1.port.onmessage = receiveMessage;

const worker2 = new SharedWorker("support/shared-name.js", { name });
worker2.port.onmessage = receiveMessage;

const worker3 = new SharedWorker("support/shared-name.js", name);
worker3.port.onmessage = receiveMessage;

let nextCounterExpected = 1;
function receiveMessage(e) {
  const { counter, name: receivedName } = e.data;

  assert_equals(receivedName, name);
  assert_equals(counter, nextCounterExpected);

  ++nextCounterExpected;
  if (nextCounterExpected === 4) {
    done();
  }
}
</script>
back to top