| Index: tests/html/interactive_test.dart
|
| diff --git a/tests/html/interactive_test.dart b/tests/html/interactive_test.dart
|
| index f688ee5bbe29a3cb8d3e94207e8ec0dcef1f1969..47bbe08475b4b8e2368c02e5c99d9a30192094af 100644
|
| --- a/tests/html/interactive_test.dart
|
| +++ b/tests/html/interactive_test.dart
|
| @@ -15,7 +15,7 @@ main() {
|
| useHtmlIndividualConfiguration();
|
|
|
| group('Geolocation', () {
|
| - futureTest('getCurrentPosition', () {
|
| + test('getCurrentPosition', () {
|
| return window.navigator.geolocation.getCurrentPosition().then(
|
| (position) {
|
| expect(position.coords.latitude, isNotNull);
|
| @@ -24,7 +24,7 @@ main() {
|
| });
|
| });
|
|
|
| - futureTest('watchPosition', () {
|
| + test('watchPosition', () {
|
| return window.navigator.geolocation.watchPosition().first.then(
|
| (position) {
|
| expect(position.coords.latitude, isNotNull);
|
| @@ -36,7 +36,7 @@ main() {
|
|
|
| group('MediaStream', () {
|
| if (MediaStream.supported) {
|
| - futureTest('getUserMedia', () {
|
| + test('getUserMedia', () {
|
| return window.navigator.getUserMedia(video: true).then((stream) {
|
| expect(stream, isNotNull);
|
|
|
| @@ -60,6 +60,37 @@ main() {
|
| return completer.future;
|
| });
|
| });
|
| +
|
| + test('getUserMediaComplexConstructor', () {
|
| + return window.navigator.getUserMedia(
|
| + video: {'mandatory':
|
| + { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 },
|
| + 'optional':
|
| + [{ 'minFrameRate': 60 },
|
| + { 'maxWidth': 640 }]
|
| + }).then((stream) {
|
| + expect(stream, isNotNull);
|
| +
|
| + var url = Url.createObjectUrl(stream);
|
| + expect(url, isNotNull);
|
| +
|
| + var video = new VideoElement()
|
| + ..autoplay = true;
|
| +
|
| + var completer = new Completer();
|
| + video.onError.listen((e) {
|
| + completer.completeError(e);
|
| + });
|
| + video.onPlaying.first.then((e) {
|
| + completer.complete(video);
|
| + });
|
| +
|
| + document.body.append(video);
|
| + video.src = url;
|
| +
|
| + return completer.future;
|
| + });
|
| + });
|
| }
|
| });
|
| }
|
|
|