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

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: Fixed the test Created 4 years, 2 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..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>
« 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