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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html

Issue 1840933002: Do not rely on broken images in http/tests/multipart/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 1 month 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/http/tests/multipart/stop-loading-after-onload1.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html b/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html
index 31383c786d877efd8849bad27efb24badd8db683..6235b355d0ed1e235dccb4910501b8e4a5bf332f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.html
@@ -1,25 +1,27 @@
<html>
<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
+var t = async_test("window.stop() can stop loading of multipart images");
function firstPartLoaded()
{
+ const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png";
+ if (window.internals) {
+ assert_true(internals.isLoading(url), "The image should be loading before window.stop().");
+ }
window.stop();
- window.setTimeout(function() {
- var broken = (testingImage.width != 2 && testingImage.width != 76);
- document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL";
- if (window.testRunner)
- testRunner.notifyDone();
- }, 100);
+ window.setTimeout(t.step_func(function() {
+ if (window.internals) {
+ assert_false(internals.isLoading(url), "The image should not be loading after window.stop().");
+ }
+ t.done();
+ }), 100);
}
</script>
</head>
<body>
-<img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png" onload="firstPartLoaded()">
-<p id="results"></p>
+<img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png" onload="t.step(firstPartLoaded)">
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698