OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 description("Tests navigator.requestMIDIAccess."); | 8 description("Tests navigator.requestMIDIAccess."); |
9 | 9 |
10 var access; | 10 var access; |
11 var output; | 11 var output; |
12 function successCallback1(a) { | 12 function successCallback1(a) { |
13 access = a; | 13 access = a; |
14 | 14 |
15 testPassed("requestMIDIAccess() succeeded with access " + access + "."); | 15 testPassed("requestMIDIAccess() succeeded with access " + access + "."); |
16 | 16 |
17 // Validate that we have one mock input and one mock output. | 17 // Validate that we have one mock input and one mock output. |
18 shouldBe("access.inputs().length", "1"); | 18 shouldBe("access.inputs().length", "1"); |
19 shouldBe("access.outputs().length", "1"); | 19 shouldBe("access.outputs().length", "1"); |
20 | 20 |
21 // Validate the values of the attributes on the access. | |
22 shouldBeDefined("access.sysexEnabled"); | |
23 shouldBe("access.sysexEnabled", "false"); | |
tkent
2014/03/24 11:52:38
Use shouldBeFalse.
| |
24 | |
21 var inputs = access.inputs(); | 25 var inputs = access.inputs(); |
22 var outputs = access.outputs(); | 26 var outputs = access.outputs(); |
23 var input = inputs[0]; | 27 var input = inputs[0]; |
24 output = outputs[0]; | 28 output = outputs[0]; |
25 | 29 |
26 // Validate the values of the attributes on the input and output. | 30 // Validate the values of the attributes on the input and output. |
27 if (input.id == "MockInputID" && | 31 if (input.id == "MockInputID" && |
28 input.manufacturer == "MockInputManufacturer" && | 32 input.manufacturer == "MockInputManufacturer" && |
29 input.name == "MockInputName" && | 33 input.name == "MockInputName" && |
30 input.version == "MockInputVersion") { | 34 input.version == "MockInputVersion") { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 } | 84 } |
81 | 85 |
82 window.jsTestIsAsync = true; | 86 window.jsTestIsAsync = true; |
83 | 87 |
84 // Test basic access, with no System Exclusive. | 88 // Test basic access, with no System Exclusive. |
85 navigator.requestMIDIAccess().then(successCallback1, errorCallback1); | 89 navigator.requestMIDIAccess().then(successCallback1, errorCallback1); |
86 | 90 |
87 </script> | 91 </script> |
88 </body> | 92 </body> |
89 </html> | 93 </html> |
OLD | NEW |