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

Unified Diff: LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html

Issue 283423005: Use Promises for screen.lockOrientation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cdumez comments Created 6 years, 7 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/screen_orientation/resources/sandboxed-iframe-locking.html
diff --git a/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html b/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html
index cc931a49fb8f982d2799fc4e92b20161486be216..7ba8d37c56b37a9a63cf07c9bcc5fa55dae8d346 100644
--- a/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html
+++ b/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html
@@ -1,9 +1,14 @@
<script>
jochen (gone - plz use gerrit) 2014/05/22 08:34:35 please add <!DOCTYPE html>
mlamouri (slow - plz ping) 2014/05/22 08:58:56 Done.
- var exceptionName = "";
- try {
- screen.lockOrientation("portrait-primary");
- } catch (ex) {
- exceptionName = ex.name;
- }
- parent.window.postMessage(exceptionName, "*");
+ var msg = "";
+ screen.lockOrientation("portrait-primary").then(function() {
+ }, function(error) {
+ msg = error.name;
+ });
+
+ // FIXME: for the moment, tests gets notified when there is a failure but
+ // not a success, this hack should allow us to still have the test running.
+ // That should be removed as soon as we get a resolved promise in tests.
+ setTimeout(function() {
+ parent.window.postMessage(msg, "*");
+ })
</script>

Powered by Google App Engine
This is Rietveld 408576698