-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import
video-cancel-load.html
from Blink / Chromium
https://bugs.webkit.org/show_bug.cgi?id=269171 Reviewed by Eric Carlson. This patch is to import test from Blink, which was updated: Partial Merge: https://source.chromium.org/chromium/chromium/src/+/25f67c81bfa8c6b1ce5a4c061ca5bd76eae32fff * LayoutTests/http/tests/media/video-cancel-load.html: Update Test Case * LayoutTests/http/tests/media/video-cancel-load-expected.txt: Add Test Case Expectation > It requires Back/Forward Test Runner flag and it seems to not work on WPE & GTK platform and previously it had `empty` line as expectation as well. So it keeps similar for GTK & WPE. * LayoutTests/platform/glib/http/tests/media/video-cancel-load-expected.txt: Add Platform Specific Test Expectation Canonical link: https://commits.webkit.org/274925@main
- Loading branch information
1 parent
0cb4c5d
commit 9099761
Showing
3 changed files
with
42 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
|
||
|
||
PASS Test that progress events are generated during loading of media resource. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,43 @@ | ||
<html> | ||
<head> | ||
<title>Cancel loading a video file and access its properties afterwards.</title> | ||
</head> | ||
<body> | ||
Access a video element with resource loading canceled. | ||
If this test is successful it will terminate with a blank page. | ||
This test should finish without crashing. | ||
<!DOCTYPE html><!-- webkit-test-runner [ JavaScriptCanOpenWindowsAutomatically=true ] --> | ||
<title>Cancel loading a video file and access its properties afterwards.</title> | ||
<video></video> | ||
|
||
<script src=../../media-resources/media-file.js></script> | ||
<script src=../../media-resources/video-test.js></script> | ||
<video controls id="video"></video> | ||
<textarea style="display: none;"> | ||
<!-- Begin child content --> | ||
<!-- The following section contains the content in the document of child window. --> | ||
<script> | ||
var video = window.opener.video; | ||
window.setTimeout(function() { | ||
var d = video.duration; | ||
testRunner.notifyDone(); | ||
}, 50); | ||
window.opener.blank(); | ||
</script> | ||
<!-- End child content --> | ||
</textarea> | ||
|
||
<textarea id="child_content" style="display: none;"> | ||
<!-- Begin child content --> | ||
<!-- The following section contains the content in the document of child window. --> | ||
<script> | ||
var video = window.opener.video; | ||
window.setTimeout(function () { | ||
var d = video.duration; | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 50); | ||
window.opener.blank(); | ||
</script> | ||
<!-- End child content --> | ||
</textarea> | ||
<script> | ||
// Access a video element with resource loading canceled. | ||
// If this test is successful it will terminate with a blank page. | ||
// This test should finish without crashing. | ||
testRunner.dumpAsText(); | ||
|
||
<script> | ||
var video = document.getElementById("video"); | ||
var file = findMediaFile("video", "../resources/test"); | ||
var video = document.querySelector("video"); | ||
|
||
// Opens a window and writes the child content into the document. | ||
video.addEventListener("loadedmetadata", function main() | ||
{ | ||
var win = window.open("", "child"); | ||
var doc = win.document; | ||
doc.open(); | ||
doc.write(document.getElementById("child_content").value); | ||
doc.close(); | ||
}); | ||
video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file; | ||
// Opens a window and writes the child content into the document. | ||
video.onloadedmetadata = function() { | ||
var win = window.open("", "child"); | ||
var doc = win.document; | ||
doc.open(); | ||
doc.write(document.querySelector("textarea").value); | ||
doc.close(); | ||
}; | ||
|
||
// Change URL of the current page to a blank page. | ||
function blank() | ||
{ | ||
location.href = "about:blank"; | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
var file = "resources/test.mp4"; | ||
video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file; | ||
|
||
// Change URL of the current page to a blank page. | ||
function blank() { | ||
location.href = "about:blank"; | ||
} | ||
</script> |
1 change: 1 addition & 0 deletions
1
LayoutTests/platform/glib/http/tests/media/video-cancel-load-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|