blob: edeccca0885298f00ad16b54b4280b98cf915929 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/media/midi/midi_service.mojom.js"></script>
<script src="../http/tests/webmidi/mock-midiservice.js"></script>
</head>
<body>
<script>
description("Tests navigator.requestMIDIAccess fails in a detached frame.");
window.jsTestIsAsync = true;
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
contentNavigator = iframe.contentWindow.navigator;
document.body.removeChild(iframe);
// set testRunner configuration so that requestMIDIAccess returns "AbortError".
contentNavigator.requestMIDIAccess().then(function() {
testFailed("requestMIDIAccess() does not fail unexpectedly.");
finishJSTest();
}, function(error) {
window.errorName = error.name;
shouldBeEqualToString("errorName", 'AbortError');
testPassed("requestMIDIAccess() fail as expected.");
finishJSTest();
});
</script>
</body>
</html>