Use message channels for communicating with iframes

The host code that runs in the browser and loads tests now uses the
Channel Messaging API to communicate with iframes. It now connects to
each test suite's iframe with its own dedicated `MessageChannel`.

This method is more robust than sending global messages through
`window.postMessage()`.

It also allows tests to modify `window.location`, which would previously
cause them to hang. This was because each iframe used `window.location`
(which is unique to each iframe) to tag messages sent using
`window.postMessage()` so that the host could identify their source.

Closes https://github.com/dart-lang/test/issues/423.
Fixes https://github.com/dart-lang/test/issues/562.
5 files changed
tree: d9df8b6bbf29c278c748d097a7ea713d11babd72
  1. pkgs/
  2. tool/
  3. .gitignore
  4. .travis.yml
  5. analysis_options.yaml
  6. codereview.settings
  7. CONTRIBUTING.md
  8. mono_repo.yaml
  9. README.md
README.md

Test Mono Repository

This repository contains packages for writing and running Dart tests.

test

A full featured packaged for writing and running Dart tests on various platforms, e.g. VM, Chrome, Node etc.

test_api

A minimal package for writing tests. This package is used by package:test and package:test_core.

test_core

A minimal package for writing and running tests. It also contains extensions for implementing a custom test runner. This package is used by package:test.