[Modern Media Controls] Media Controller: click-to-start support
[WebKit-https.git] / LayoutTests / media / modern-media-controls / start-support / start-support-autoplay.html
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/main.js" type="text/javascript"></script>
 <body>
-<video src="../../content/test.mp4" style="width: 320px; height: 240px;"></video>
+<video src="../../content/test.mp4" style="width: 320px; height: 240px;" autoplay></video>
 <div id="shadow"></div>
 <script type="text/javascript">
 
 window.jsTestIsAsync = true;
 
-description("Testing the <code>MediaController</code> click-to-start behavior.");
+description("Testing the <code>StartSupport</code> behavior with autoplay.");
 
 iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
 
@@ -42,8 +44,6 @@ const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "op
 const media = document.querySelector("video");
 const mediaController = createControls(shadowRoot, media, null);
 
-shouldBeTrue("mediaController.controls.showsStartButton");
-
 media.addEventListener("play", function() {
     debug("Media is playing");
     shouldBeFalse("mediaController.controls.showsStartButton");
@@ -53,10 +53,6 @@ media.addEventListener("play", function() {
     finishJSTest();
 });
 
-debug("");
-debug("Dispatching click event to the start button");
-mediaController.controls.startButton.element.click();
-
 </script>
 <script src="../../../resources/js-test-post.js"></script>
 </body>