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

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: review commenst 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
« no previous file with comments | « LayoutTests/screen_orientation/lockOrientation-basic-expected.txt ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8b81f64b91202f68bf917c5b1cf46f2d7a697154 100644
--- a/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html
+++ b/LayoutTests/screen_orientation/resources/sandboxed-iframe-locking.html
@@ -1,9 +1,17 @@
+<!DOCTYPE html>
+<html>
<script>
- 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>
+</html>
« no previous file with comments | « LayoutTests/screen_orientation/lockOrientation-basic-expected.txt ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698