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

Unified Diff: LayoutTests/webmidi/requestmidiaccess-in-detached-frame.html

Issue 77773003: Make WebMIDI use blink Promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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-in-detached-frame.html
diff --git a/LayoutTests/webmidi/requestmidiaccess-fail.html b/LayoutTests/webmidi/requestmidiaccess-in-detached-frame.html
similarity index 52%
copy from LayoutTests/webmidi/requestmidiaccess-fail.html
copy to LayoutTests/webmidi/requestmidiaccess-in-detached-frame.html
index 1baaedc91786a059725b7dedbe3d573359556086..8c7c718d52d229bd48c4a92d5e490b7a6004f0af 100644
--- a/LayoutTests/webmidi/requestmidiaccess-fail.html
+++ b/LayoutTests/webmidi/requestmidiaccess-in-detached-frame.html
@@ -5,7 +5,7 @@
</head>
<body>
<script>
-description("Tests navigator.requestMIDIAccess failure.");
+description("Tests navigator.requestMIDIAccess fails in a detached frame.");
function successCallback(access) {
testFailed("requestMIDIAccess() does not fail unexpectedly.");
@@ -19,11 +19,16 @@ function errorCallback(error) {
finishJSTest();
}
-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 "InvalidStateError".
-testRunner.setMIDIAccessorResult(false);
-shouldNotThrow("navigator.requestMIDIAccess().then(successCallback, errorCallback)");
+contentNavigator.requestMIDIAccess().then(successCallback, errorCallback);
+// FIXME: errorCallback should be called, but due to the Blink Promise impelementation the
+// returned Promise never be resolved nor rejected.
+finishJSTest();
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698