diff options
Diffstat (limited to 'android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi')
4 files changed, 59 insertions, 0 deletions
diff --git a/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-expected.txt b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-expected.txt new file mode 100644 index 0000000..a758a32 --- /dev/null +++ b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-expected.txt @@ -0,0 +1,6 @@ +Test navigator.requestMIDIAccess API in WebView +onPermissionRequest: android.webkit.resource.MIDI_SYSEX +request granted: android.webkit.resource.MIDI_SYSEX +PASS: access.sysexEnabled is true +PASS: requestMIDIAccess with option sysex:true succeeded. +TEST FINISHED
\ No newline at end of file diff --git a/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied-expected.html b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied-expected.html new file mode 100644 index 0000000..6db4ae5 --- /dev/null +++ b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied-expected.html @@ -0,0 +1,5 @@ +Test navigator.requestMIDIAccess API in WebView +onPermissionRequest: android.webkit.resource.MIDI_SYSEX +request denied +PASS: requestMIDIAccess error, reason: SecurityError: An attempt was made to break through the security policy of the user agent. +TEST FINISHED
\ No newline at end of file diff --git a/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied.html b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied.html new file mode 100644 index 0000000..aabd8c1 --- /dev/null +++ b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess-permission-denied.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <script src="../../resources/js-test.js"></script> + <body> + <script type="text/javascript"> + description("Test navigator.requestMIDIAccess API in WebView"); + window.jsTestIsAsync = true; + + function onMIDIError(errorMessage) { + testPassed('requestMIDIAccess error, reason: ' + errorMessage); + finishJSTest(); + } + + function onMIDISuccess(stream) { + testFail('access was granted but should not have been.'); + finishJSTest(); + } + + navigator.requestMIDIAccess({sysex:true}).then( + onMIDISuccess, onMIDIError); + </script> + </body> +</html>
\ No newline at end of file diff --git a/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess.html b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess.html new file mode 100644 index 0000000..58258be --- /dev/null +++ b/android_webview/tools/system_webview_shell/test/data/blink-apis/webmidi/requestmidiaccess.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> + <script src="../../resources/js-test.js"></script> + <body> + <script type="text/javascript"> + description("Test navigator.requestMIDIAccess API in WebView"); + window.jsTestIsAsync = true; + + function onMIDIError(errorMessage) { + testFailed('requestMIDIAccess error callback, reason: ' + errorMessage); + finishJSTest(); + } + + function onMIDISuccess(access) { + window.access = access; + shouldBeTrue('access.sysexEnabled'); + testPassed('requestMIDIAccess with option sysex:true succeeded.'); + finishJSTest(); + } + + navigator.requestMIDIAccess({sysex:true}).then( + onMIDISuccess, onMIDIError); + </script> + </body> +</html>
\ No newline at end of file |