OLD | NEW |
1 #library('AudioElementTest'); | 1 library AudioElementTest; |
2 #import('../../pkg/unittest/unittest.dart'); | 2 import '../../pkg/unittest/lib/unittest.dart'; |
3 #import('../../pkg/unittest/html_config.dart'); | 3 import '../../pkg/unittest/lib/html_config.dart'; |
4 #import('dart:html'); | 4 import 'dart:html'; |
5 | 5 |
6 main() { | 6 main() { |
7 | 7 |
8 useHtmlConfiguration(); | 8 useHtmlConfiguration(); |
9 | 9 |
10 var isAudioElement = | 10 var isAudioElement = |
11 predicate((x) => x is AudioElement, 'is an AudioElement'); | 11 predicate((x) => x is AudioElement, 'is an AudioElement'); |
12 | 12 |
13 test('constructorTest1', () { | 13 test('constructorTest1', () { |
14 var audio = new AudioElement(); // would be new Audio() in JS | 14 var audio = new AudioElement(); // would be new Audio() in JS |
15 expect(audio, isNotNull); | 15 expect(audio, isNotNull); |
16 expect(audio, isAudioElement); | 16 expect(audio, isAudioElement); |
17 }); | 17 }); |
18 | 18 |
19 test('constructorTest2', () { | 19 test('constructorTest2', () { |
20 var audio = new AudioElement('hahaURL'); | 20 var audio = new AudioElement('hahaURL'); |
21 expect(audio, isNotNull); | 21 expect(audio, isNotNull); |
22 expect(audio, isAudioElement); | 22 expect(audio, isAudioElement); |
23 expect(audio.src.indexOf('hahaURL'), greaterThanOrEqualTo(0)); | 23 expect(audio.src.indexOf('hahaURL'), greaterThanOrEqualTo(0)); |
24 }); | 24 }); |
25 } | 25 } |
OLD | NEW |