blob: 3b7cf7f3d52a08025dc99091c36f7e4008f91460 [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'package:expect/minitest.dart';
main() {
var uri = Uri.parse(window.location.href);
var crossOriginPort = int.parse(uri.queryParameters['crossOriginPort']);
var crossOrigin = '${uri.scheme}://${}:$crossOriginPort';
var crossOriginUrl =
var iframe = new IFrameElement();
iframe.src = crossOriginUrl;
return window.onMessage
.where((MessageEvent event) {
return event.origin == crossOrigin;
.then((MessageEvent event) {
expect(, equals('foobar'));
expect(event.source, isNotNull);