https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 87ab33ad66664bc19c0b9b54493a496e621ccf96 authored by L. David Baron on 04 April 2018, 23:15:54 UTC
Sync Mozilla tests as of https://hg.mozilla.org/mozilla-central/rev/071ee904485e21e19ca08456d32bce6825b77a26 .
Tip revision: 87ab33a
wasm_serialization_tests.js
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function TestInstantiateInWorker() {
  return createWasmModule()
    .then((mod) => {
      var worker = new Worker("wasm_serialization_worker.js");
      return new Promise((resolve, reject) => {
        worker.postMessage(mod);
        worker.onmessage = function(event) {
          resolve(event.data);
        }
      });
    })
    .then(data => assert_equals(data, 43))
    .catch(error => assert_unreached(error));
}
back to top