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

Unified Diff: third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html

Issue 2021693002: Convert controls-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits Created 4 years, 7 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/LayoutTests/media/controls-right-click-on-timebar-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
diff --git a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
index a6009c57a8a7d125757ee13667d3552b1be61306..39cd50f8f0e6062a729d2da108fc6709eee58ccb 100644
--- a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
+++ b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
@@ -1,59 +1,30 @@
-<html>
- <head>
- <title>right click on timebar test</title>
- <script src=media-controls.js></script>
- <script src=media-file.js></script>
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=video-test.js></script>
- <script>
- if (window.testRunner)
- testRunner.dumpAsText();
+<!DOCTYPE html>
+<title>Test that right clicking on the timebar does not cause a seek.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<script src="media-controls.js"></script>
+<video controls></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- function click()
- {
- if (window.eventSender) {
- var seekCoords;
- try {
- seekCoords = mediaControlsButtonCoordinates(video, "timeline");
- } catch (exception) {
- failTest(exception.description);
- return;
- }
- var x = seekCoords[0];
- var y = seekCoords[1];
+ video.onplaying = t.step_func(function() {
+ setTimeout(t.step_func(click), 100);
+ });
- eventSender.mouseMoveTo(x, y);
- eventSender.contextClick();
- }
- window.setTimeout("endTest()", 200);
- }
+ video.onseeked = t.unreached_func();
- function playing()
- {
- window.setTimeout("click()", 100);
- }
+ video.autoplay = true;
+ video.src = findMediaFile("video", "content/test");
- function seeked()
- {
- failTest("Should not seek.");
- }
+ function click() {
+ var seekCoords = mediaControlsButtonCoordinates(video, "timeline");
- function start()
- {
- findMediaElement();
- waitForEvent('playing', playing);
- waitForEvent('seeked', seeked);
- run("video.autoplay = true");
- disableFullTestDetailsPrinting();
- runSilently("video.src = '" + findMediaFile("video", "content/test") + "'");
- enableFullTestDetailsPrinting();
- }
- </script>
- </head>
+ eventSender.mouseMoveTo(seekCoords[0], seekCoords[1]);
+ eventSender.contextClick();
- <body onload="start()">
- <p>Test that right clicking on the timebar does not cause a seek.</p>
- <video controls></video>
- </body>
-</html>
+ setTimeout(t.step_func_done(), 200);
+ }
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698