mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:30:32 +00:00
09e47b6177
Some none Dart files were not copied over in the migration. Tests are refactored to use the lib version over lib_2. Change-Id: I21053d81770c4f83b01f27af99cec11f08577c7b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143330 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com>
30 lines
942 B
Dart
30 lines
942 B
Dart
// 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}://${uri.host}:$crossOriginPort';
|
|
var crossOriginUrl =
|
|
'$crossOrigin/root_dart/tests/lib/html/cross_domain_iframe_script.html';
|
|
|
|
var iframe = new IFrameElement();
|
|
iframe.src = crossOriginUrl;
|
|
document.body!.append(iframe);
|
|
|
|
return window.onMessage
|
|
.where((MessageEvent event) {
|
|
return event.origin == crossOrigin;
|
|
})
|
|
.first
|
|
.then((MessageEvent event) {
|
|
expect(event.data, equals('foobar'));
|
|
expect(event.source, isNotNull);
|
|
});
|
|
}
|