OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>Test that calling prompt() before the promise returned by the pre vious call is resolved throws an exception</title> | |
5 <script src="../../resources/testharness.js"></script> | |
6 <script src="../../resources/testharnessreport.js"></script> | |
7 <script src="../media-file.js"></script> | |
8 </head> | |
9 <body> | |
10 <button id="button">Click me</button> | |
11 <script> | |
12 function clickOnElem(e) { | |
13 eventSender.mouseMoveTo( | |
14 e.offsetLeft + e.offsetWidth / 2, | |
15 e.offsetTop + e.offsetHeight / 2); | |
16 eventSender.mouseDown(); | |
17 eventSender.mouseUp(); | |
18 } | |
19 | |
20 async_test(function(test) | |
21 { | |
22 var v = document.createElement('video'); | |
23 v.src = findMediaFile('video', 'content/test'); | |
24 document.body.appendChild(v); | |
25 | |
26 var btn = document.getElementById('button'); | |
27 btn.onclick = function() { | |
28 v.remote.prompt(); | |
29 | |
30 btn.onclick = function() { | |
31 v.remote.prompt().then( | |
32 test.unreached_func(), | |
33 test.step_func_done(function(e) { | |
34 assert_equals(e.name, 'OperationError'); | |
35 assert_equals(e.message, 'A prompt is already be ing shown for this media element.'); | |
36 })); | |
37 btn.onclick = null; | |
38 }; | |
39 clickOnElem(btn); | |
40 } | |
41 | |
42 clickOnElem(btn); | |
43 }, 'Test that calling prompt() before the promise returned by the pr evious call is resolved throws an exception.'); | |
44 </script> | |
45 </body> | |
mlamouri (slow - plz ping)
2016/10/04 10:48:47
This file is over-indented. LayoutTests are usuall
| |
46 </html> | |
OLD | NEW |