Chromium Code Reviews| 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 | 8 |
| 9 description("Test if sysex permission request is handled."); | 9 description("Test if sysex permission request is handled."); |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 else | 33 else |
| 34 finishSuccessfully(); | 34 finishSuccessfully(); |
| 35 }); | 35 }); |
| 36 } | 36 } |
| 37 | 37 |
| 38 var acceptSysEx = function (next) { | 38 var acceptSysEx = function (next) { |
| 39 testRunner.setMIDISysExPermission(true); | 39 testRunner.setMIDISysExPermission(true); |
| 40 promise = navigator.requestMIDIAccess({sysex: true}); | 40 promise = navigator.requestMIDIAccess({sysex: true}); |
| 41 shouldBeDefined("promise"); | 41 shouldBeDefined("promise"); |
| 42 shouldBeDefined("promise.then"); | 42 shouldBeDefined("promise.then"); |
| 43 promise.then(function(access) { | 43 promise.then(function(a) { |
| 44 testPassed("sysex permission request is successfully accepted."); | 44 testPassed("sysex permission request is successfully accepted."); |
| 45 access = a; | |
|
Takashi Toyoshima
2014/03/24 11:38:10
Make |access| global to be available from shouldBe
| |
| 46 shouldBeDefined("access"); | |
| 47 shouldBeDefined("access.sysexEnabled"); | |
| 48 shouldBe("access.sysexEnabled", "true"); | |
|
tkent
2014/03/24 11:52:38
shouldBe -> shouldBeTrue
| |
| 45 if (next) | 49 if (next) |
| 46 next(); | 50 next(); |
| 47 else | 51 else |
| 48 finishSuccessfully(); | 52 finishSuccessfully(); |
| 49 }, function (error) { | 53 }, function (error) { |
| 50 testFailed("sysex permission request should be accepted."); | 54 testFailed("sysex permission request should be accepted."); |
| 51 finishJSTest(); | 55 finishJSTest(); |
| 52 }); | 56 }); |
| 53 } | 57 } |
| 54 | 58 |
| 55 rejectSysEx(acceptSysEx); | 59 rejectSysEx(acceptSysEx); |
| 56 | 60 |
| 57 </script> | 61 </script> |
| 58 </body> | 62 </body> |
| 59 </html> | 63 </html> |
| OLD | NEW |