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

Unified Diff: third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html

Issue 2347763002: [Blink, RemotePlayback] Reject the prompt() with OperationError if there's a pending promise for th… (Closed)
Patch Set: Addressed Mounir's comments Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..737f4671e3c56ac63c4654271106fb7b9853e6e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html
@@ -0,0 +1,34 @@
+<!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>
+ <script>
+ async_test(function(test)
+ {
+ var v = document.createElement('video');
+ v.src = findMediaFile('video', 'content/test');
+ document.body.appendChild(v);
+
+ document.onclick = function() {
+ v.remote.prompt();
+
+ v.remote.prompt().then(
mlamouri (slow - plz ping) 2016/10/01 14:55:53 Maybe you should have another simulated user gestu
whywhat 2016/10/03 20:39:01 Hm, if the checks are reversed, the utiliseUserGes
+ 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.');
+ }));
+ document.onclick = null;
+ }
+
+ eventSender.mouseDown();
+ eventSender.mouseUp();
mlamouri (slow - plz ping) 2016/10/01 14:55:53 Having a <button>click me</button> as a target wou
whywhat 2016/10/03 20:39:01 Alright. I'll try to remember to point noone to th
+ }, 'Test that calling prompt() before the promise returned by the previous call is resolved throws an exception.');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698