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

Side by Side Diff: LayoutTests/media/activation-behavior-shadow.html

Issue 208483002: Implement the activation behavior of media elements (click to play/pause) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: cancel activation behavior in a failing fullscreen test Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <title>activation behavior with shadow children</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <video controls></video>
6 <script>
7 function shouldTogglePlayState(shadowChild)
8 {
9 var id = internals.shadowPseudoId(shadowChild);
10 if (id == "-webkit-media-controls")
11 return true;
12 if (id == "-webkit-media-controls-play-button")
13 return true;
14 if (id == "-webkit-media-controls-panel")
15 return false;
16 return shouldTogglePlayState(shadowChild.parentNode);
17 }
18
19 test(function()
20 {
21 var v = document.querySelector("video");
22 var shadowChildren = internals.shadowRoot(v).querySelectorAll("*");
23 Array.prototype.forEach.call(shadowChildren, function(shadowChild)
24 {
25 v.pause();
26 shadowChild.click();
27 assert_equals(v.paused, !shouldTogglePlayState(shadowChild),
28 "paused state after click element with pseudo id '"
29 + internals.shadowPseudoId(shadowChild) + "'");
30 });
31 });
32 </script>
OLDNEW
« no previous file with comments | « LayoutTests/media/activation-behavior-expected.txt ('k') | LayoutTests/media/activation-behavior-shadow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698