webkitpy: Implement device type specific expected results (Part 2)
[WebKit-https.git] / LayoutTests / platform / ipad / media / modern-media-controls / pip-support / pip-support-enabled.html
1 <script src="../../../../../resources/js-test-pre.js"></script>
2 <script src="../../../../../media/modern-media-controls/resources/media-controls-loader.js" type="text/javascript"></script>
3 <body>
4 <style type="text/css" media="screen">
5     
6     video, #host {
7         position: absolute;
8         top: 0;
9         left: 0;
10     }
11
12     video {
13         width: 800px;
14         height: 240px;
15     }
16     
17 </style>
18 <video src="../../../../../media/content/test.mp4" controls autoplay></video>
19 <div id="host"></div>
20 <script type="text/javascript">
21
22 window.jsTestIsAsync = true;
23
24 description("Testing the <code>PipSupport</code> behavior.");
25
26 const container = document.querySelector("div#host");
27 const media = document.querySelector("video");
28 const mediaController = createControls(container, media, null);
29
30 media.addEventListener("loadedmetadata", () => {
31     shouldBeTrue("mediaController.controls.pipButton.enabled");
32     media.src = "";
33 });
34
35 media.addEventListener("error", () => {
36     shouldBeFalse("mediaController.controls.pipButton.enabled");
37     debug("");
38     container.remove();
39     media.remove();
40     finishJSTest();
41 });
42
43 </script>
44 <script src="../../../../../resources/js-test-post.js"></script>
45 </body>