Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: LayoutTests/webmidi/requestmidiaccess.html

Issue 23135009: Improve IDB module's SecurityError messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/webmidi/requestmidiaccess.html
diff --git a/LayoutTests/webmidi/requestmidiaccess.html b/LayoutTests/webmidi/requestmidiaccess.html
index 0696dc7a2544769704da52862ac1dbfd7ad0d56e..9d81ebda5b21d34e9c460848935bb70609692498 100644
--- a/LayoutTests/webmidi/requestmidiaccess.html
+++ b/LayoutTests/webmidi/requestmidiaccess.html
@@ -11,7 +11,7 @@
description("Tests navigator.requestMIDIAccess.");
var access;
-
+var output;
function successCallback1(a) {
access = a;
@@ -24,7 +24,7 @@ function successCallback1(a) {
var inputs = access.inputs();
var outputs = access.outputs();
var input = inputs[0];
- var output = outputs[0];
+ output = outputs[0];
// Validate the values of the attributes on the input and output.
if (input.id == "MockInputID" &&
@@ -55,6 +55,9 @@ function successCallback1(a) {
// Test sending of MIDI data with a regular Array giving an explicit timestamp.
output.send([0x90, 0x45, 0x7f], performance.now());
+ // Test sending system exclusive messages. These should throw, since we don't have sysex access.
+ shouldThrow('output.send([0xf1, 0x45, 0x7f])', '"SecurityError: Failed to execute \'send\' on \'MIDIOutput\': permission to send system exclusive messages is denied."');
+
// Now test System Exclusive access - our test mock should not allow this type of access.
try {
navigator.requestMIDIAccess( { sysex: true } ).then(successCallback2, errorCallback2);

Powered by Google App Engine
This is Rietveld 408576698