OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library interactive_test; | 5 library interactive_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import '../../pkg/unittest/lib/unittest.dart'; | 9 import '../../pkg/unittest/lib/unittest.dart'; |
10 import '../../pkg/unittest/lib/html_individual_config.dart'; | 10 import '../../pkg/unittest/lib/html_individual_config.dart'; |
(...skipping 22 matching lines...) Expand all Loading... |
33 }); | 33 }); |
34 }); | 34 }); |
35 }); | 35 }); |
36 | 36 |
37 group('MediaStream', () { | 37 group('MediaStream', () { |
38 if (MediaStream.supported) { | 38 if (MediaStream.supported) { |
39 test('getUserMedia', () { | 39 test('getUserMedia', () { |
40 return window.navigator.getUserMedia(video: true).then((stream) { | 40 return window.navigator.getUserMedia(video: true).then((stream) { |
41 expect(stream, isNotNull); | 41 expect(stream, isNotNull); |
42 | 42 |
43 var url = Url.createObjectUrl(stream); | 43 var url = Url.createObjectUrlFromStream(stream); |
44 expect(url, isNotNull); | 44 expect(url, isNotNull); |
45 | 45 |
46 var video = new VideoElement() | 46 var video = new VideoElement() |
47 ..autoplay = true; | 47 ..autoplay = true; |
48 | 48 |
49 var completer = new Completer(); | 49 var completer = new Completer(); |
50 video.onError.listen((e) { | 50 video.onError.listen((e) { |
51 completer.completeError(e); | 51 completer.completeError(e); |
52 }); | 52 }); |
53 video.onPlaying.first.then((e) { | 53 video.onPlaying.first.then((e) { |
(...skipping 10 matching lines...) Expand all Loading... |
64 test('getUserMediaComplexConstructor', () { | 64 test('getUserMediaComplexConstructor', () { |
65 return window.navigator.getUserMedia( | 65 return window.navigator.getUserMedia( |
66 video: {'mandatory': | 66 video: {'mandatory': |
67 { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 }, | 67 { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 }, |
68 'optional': | 68 'optional': |
69 [{ 'minFrameRate': 60 }, | 69 [{ 'minFrameRate': 60 }, |
70 { 'maxWidth': 640 }] | 70 { 'maxWidth': 640 }] |
71 }).then((stream) { | 71 }).then((stream) { |
72 expect(stream, isNotNull); | 72 expect(stream, isNotNull); |
73 | 73 |
74 var url = Url.createObjectUrl(stream); | 74 var url = Url.createObjectUrlFromStream(stream); |
75 expect(url, isNotNull); | 75 expect(url, isNotNull); |
76 | 76 |
77 var video = new VideoElement() | 77 var video = new VideoElement() |
78 ..autoplay = true; | 78 ..autoplay = true; |
79 | 79 |
80 var completer = new Completer(); | 80 var completer = new Completer(); |
81 video.onError.listen((e) { | 81 video.onError.listen((e) { |
82 completer.completeError(e); | 82 completer.completeError(e); |
83 }); | 83 }); |
84 video.onPlaying.first.then((e) { | 84 video.onPlaying.first.then((e) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 keydownHandlerTest); | 129 keydownHandlerTest); |
130 KeyboardEventStream.onKeyPress(document.body).listen( | 130 KeyboardEventStream.onKeyPress(document.body).listen( |
131 keypressHandlerTest); | 131 keypressHandlerTest); |
132 KeyboardEventStream.onKeyUp(document.body).listen( | 132 KeyboardEventStream.onKeyUp(document.body).listen( |
133 keyupHandlerTest); | 133 keyupHandlerTest); |
134 KeyboardEventStream.onKeyUp(document.body).listen( | 134 KeyboardEventStream.onKeyUp(document.body).listen( |
135 keyupHandlerTest2); | 135 keyupHandlerTest2); |
136 }); | 136 }); |
137 }); | 137 }); |
138 } | 138 } |
OLD | NEW |