Index: third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html |
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a14115ccbe37d8636e6f0f7efc532e949f0ec28 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html |
@@ -0,0 +1,46 @@ |
+<!DOCTYPE html> |
+<html> |
+ <head> |
+ <title>Test that calling prompt() before the promise returned by the previous call is resolved throws an exception</title> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="../media-file.js"></script> |
+ </head> |
+ <body> |
+ <button id="button">Click me</button> |
+ <script> |
+ function clickOnElem(e) { |
+ eventSender.mouseMoveTo( |
+ e.offsetLeft + e.offsetWidth / 2, |
+ e.offsetTop + e.offsetHeight / 2); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+ |
+ async_test(function(test) |
+ { |
+ var v = document.createElement('video'); |
+ v.src = findMediaFile('video', 'content/test'); |
+ document.body.appendChild(v); |
+ |
+ var btn = document.getElementById('button'); |
+ btn.onclick = function() { |
+ v.remote.prompt(); |
+ |
+ btn.onclick = function() { |
+ v.remote.prompt().then( |
+ test.unreached_func(), |
+ test.step_func_done(function(e) { |
+ assert_equals(e.name, 'OperationError'); |
+ assert_equals(e.message, 'A prompt is already being shown for this media element.'); |
+ })); |
+ btn.onclick = null; |
+ }; |
+ clickOnElem(btn); |
+ } |
+ |
+ clickOnElem(btn); |
+ }, 'Test that calling prompt() before the promise returned by the previous call is resolved throws an exception.'); |
+ </script> |
+ </body> |
mlamouri (slow - plz ping)
2016/10/04 10:48:47
This file is over-indented. LayoutTests are usuall
|
+</html> |