Title: [248404] trunk
Revision
248404
Author
[email protected]
Date
2019-08-08 01:20:41 -0700 (Thu, 08 Aug 2019)

Log Message

Import lazy loading WPT tests
https://bugs.webkit.org/show_bug.cgi?id=199795

Patch by Rob Buis <[email protected]> on 2019-08-08
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import lazy loading WPT tests.

* resources/import-expectations.json:
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/resources/image.png: Added.
* web-platform-tests/loading/lazyload/resources/subframe.html: Added.
* web-platform-tests/loading/lazyload/resources/w3c-import.log: Added.
* web-platform-tests/loading/lazyload/w3c-import.log: Added.

Tools:

Only do loading/ exception for WebKit specific, non WPT tests.

* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldLogFrameLoadDelegates):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):

LayoutTests:

Skip the lazy tests for now.

* TestExpectations:
* http/wpt/loading/redirect-headers-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248403 => 248404)


--- trunk/LayoutTests/ChangeLog	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/LayoutTests/ChangeLog	2019-08-08 08:20:41 UTC (rev 248404)
@@ -1,3 +1,15 @@
+2019-08-08  Rob Buis  <[email protected]>
+
+        Import lazy loading WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=199795
+
+        Reviewed by Darin Adler.
+
+        Skip the lazy tests for now.
+
+        * TestExpectations:
+        * http/wpt/loading/redirect-headers-expected.txt:
+
 2019-08-07  Yury Semikhatsky  <[email protected]>
 
         LayoutTest inspector/worker/debugger-scripts.html is a flaky failure

Modified: trunk/LayoutTests/TestExpectations (248403 => 248404)


--- trunk/LayoutTests/TestExpectations	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/LayoutTests/TestExpectations	2019-08-08 08:20:41 UTC (rev 248404)
@@ -3464,3 +3464,6 @@
 fast/text/design-system-ui-14.html [ ImageOnlyFailure ]
 fast/text/design-system-ui-15.html [ ImageOnlyFailure ]
 fast/text/design-system-ui-16.html [ ImageOnlyFailure ]
+
+webkit.org/b/196698 imported/w3c/web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html
+webkit.org/b/196698 imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html

Modified: trunk/LayoutTests/http/wpt/loading/redirect-headers-expected.txt (248403 => 248404)


--- trunk/LayoutTests/http/wpt/loading/redirect-headers-expected.txt	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/LayoutTests/http/wpt/loading/redirect-headers-expected.txt	2019-08-08 08:20:41 UTC (rev 248404)
@@ -1,9 +1,4 @@
-main frame - didStartProvisionalLoadForFrame
-main frame - didCommitLoadForFrame
-main frame - didFinishDocumentLoadForFrame
 http://localhost:8800/WebKit/beacon/resources/redirect.py?status=302&location=/ - willSendRequest <NSURLRequest URL http://localhost:8800/WebKit/beacon/resources/redirect.py?status=302&location=/, main document URL http://localhost:8800/WebKit/loading/redirect-headers.html, http method GET> redirectResponse (null)
-main frame - didHandleOnloadEventsForFrame
-main frame - didFinishLoadForFrame
 http://localhost:8800/WebKit/loading/redirect-headers.html - didFinishLoading
 http://localhost:8800/WebKit/beacon/resources/redirect.py?status=302&location=/ - willSendRequest <NSURLRequest URL http://localhost:8800/?status=302&location=%2F&count=1, main document URL http://localhost:8800/WebKit/loading/redirect-headers.html, http method GET> redirectResponse <NSURLResponse http://localhost:8800/WebKit/beacon/resources/redirect.py?status=302&location=/, http status code 302, 6 headers>
 http://localhost:8800/WebKit/beacon/resources/redirect.py?status=302&location=/ - didReceiveResponse <NSURLResponse http://localhost:8800/?status=302&location=%2F&count=1, http status code 200>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (248403 => 248404)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-08-08 08:20:41 UTC (rev 248404)
@@ -1,3 +1,24 @@
+2019-08-08  Rob Buis  <[email protected]>
+
+        Import lazy loading WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=199795
+
+        Reviewed by Darin Adler.
+
+        Import lazy loading WPT tests.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt: Added.
+        * web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html: Added.
+        * web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html: Added.
+        * web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt: Added.
+        * web-platform-tests/loading/lazyload/image-loading-eager.tentative.html: Added.
+        * web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html: Added.
+        * web-platform-tests/loading/lazyload/resources/image.png: Added.
+        * web-platform-tests/loading/lazyload/resources/subframe.html: Added.
+        * web-platform-tests/loading/lazyload/resources/w3c-import.log: Added.
+        * web-platform-tests/loading/lazyload/w3c-import.log: Added.
+
 2019-08-05  Youenn Fablet  <[email protected]>
 
         Response constructor doesn't throw on disturbed ReadableStream

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (248403 => 248404)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2019-08-08 08:20:41 UTC (rev 248404)
@@ -261,6 +261,7 @@
     "web-platform-tests/intersection-observer": "import", 
     "web-platform-tests/js": "skip", 
     "web-platform-tests/keyboard-lock": "skip", 
+    "web-platform-tests/loading/lazyload": "import", 
     "web-platform-tests/longtask-timing": "skip", 
     "web-platform-tests/magnetometer": "skip", 
     "web-platform-tests/mathml": "import", 

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,5 @@
+
+
+
+PASS Test that iframes with loading='eager' load immediately regardless of their position with respect to the viewport. 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+  <title>Iframes with loading='eager' load immediately regardless of their position with respect to the viewport.</title>
+  <link rel="author" title="Scott Little" href=""
+  <link rel="help" href=""
+  <script src=""
+  <script src=""
+</head>
+
+<!--
+Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
+-->
+
+<script>
+  const t = async_test("Test that iframes with loading='eager' load immediately regardless of their position with respect to the viewport.");
+
+  let has_in_viewport_loaded = false;
+  const in_viewport_iframe_onload = t.step_func(function() {
+    assert_false(has_in_viewport_loaded, "The in_viewport element should load only once.");
+    has_in_viewport_loaded = true;
+  });
+
+  let has_below_viewport_loaded = false;
+  const below_viewport_iframe_onload = t.step_func(function() {
+    assert_false(has_below_viewport_loaded, "The below_viewport element should load only once.");
+    has_below_viewport_loaded = true;
+  });
+
+  window.addEventListener("load", t.step_func_done(function() {
+    assert_true(has_in_viewport_loaded, "The in_viewport element should have loaded before window.load().");
+    assert_true(has_below_viewport_loaded, "The below_viewport element should have loaded before window.load().");
+  }));
+</script>
+
+<body>
+  <iframe id="in_viewport" src="" loading="eager" width="200px" height="100px" _onload_="in_viewport_iframe_onload();">
+  </iframe>
+  <div style="height:10000px;"></div>
+
+  <!--
+    The below_viewport element loads very slowly in order to ensure that the
+    window load event is blocked on it.
+  -->
+  <iframe id="below_viewport" src="" loading="eager" width="200px" height="100px" _onload_="below_viewport_iframe_onload();">
+  </iframe>
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<head>
+  <title>Iframes with loading='lazy' load when in the viewport</title>
+  <link rel="author" title="Scott Little" href=""
+  <link rel="help" href=""
+  <script src=""
+  <script src=""
+</head>
+
+<!--
+Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
+-->
+
+<script>
+  const t = async_test("Test that iframes with loading='lazy' load once they enter the viewport.");
+
+  let has_window_loaded = false;
+  let has_in_viewport_loaded = false;
+
+  const in_viewport_iframe_onload = t.step_func(function() {
+    assert_false(has_in_viewport_loaded, "The in_viewport element should load only once.");
+    has_in_viewport_loaded = true;
+  });
+
+  window.addEventListener("load", t.step_func(function() {
+    assert_true(has_in_viewport_loaded, "The in_viewport element should have loaded before window.load().");
+    assert_false(has_window_loaded, "The window.load() event should only fire once.");
+    has_window_loaded = true;
+    document.getElementById("below_viewport").scrollIntoView();
+  }));
+
+  const below_viewport_iframe_onload = t.step_func_done(function() {
+    assert_true(has_window_loaded, "The window.load() event should have fired before below_viewport loaded.");
+  });
+</script>
+
+<body>
+  <iframe id="in_viewport" src="" loading="lazy" width="200px" height="100px" _onload_="in_viewport_iframe_onload();">
+  </iframe>
+  <div style="height:10000px;"></div>
+  <iframe id="below_viewport" src="" loading="lazy" width="200px" height="100px" _onload_="below_viewport_iframe_onload();">
+  </iframe>
+
+  <!--
+    This async script loads very slowly in order to ensure that, if the
+    below_viewport element has started loading, it has a chance to finish
+    loading before window.load() happens, so that the test will dependably fail
+    in that case instead of potentially passing depending on how long different
+    resource fetches take.
+  -->
+  <script async src=""
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,5 @@
+
+
+
+PASS Test that images with loading='eager' load immediately regardless of their position with respect to the viewport. 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative.html (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative.html	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+  <title>Images with loading='eager' load immediately regardless of their position with respect to the viewport</title>
+  <link rel="author" title="Scott Little" href=""
+  <link rel="help" href=""
+  <script src=""
+  <script src=""
+</head>
+
+<!--
+Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
+-->
+
+<script>
+  const t = async_test("Test that images with loading='eager' load immediately regardless of their position with respect to the viewport.");
+
+  let has_in_viewport_loaded = false;
+  const in_viewport_img_onload = t.step_func(function() {
+    assert_false(has_in_viewport_loaded, "The in_viewport element should load only once.");
+    has_in_viewport_loaded = true;
+  });
+
+  let has_below_viewport_loaded = false;
+  const below_viewport_img_onload = t.step_func(function() {
+    assert_false(has_below_viewport_loaded, "The below_viewport element should load only once.");
+    has_below_viewport_loaded = true;
+  });
+
+  window.addEventListener("load", t.step_func_done(function() {
+    assert_true(has_in_viewport_loaded, "The in_viewport element should have loaded before window.load().");
+    assert_true(has_below_viewport_loaded, "The below_viewport element should have loaded before window.load().");
+  }));
+
+</script>
+
+<body>
+  <img id="in_viewport" src="" loading="eager" _onload_="in_viewport_img_onload();">
+  <div style="height:10000px;"></div>
+  <!--
+    The below_viewport element loads very slowly in order to ensure that the
+    window load event is blocked on it.
+  -->
+  <img id="below_viewport" src="" loading="eager" _onload_="below_viewport_img_onload();">
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<head>
+  <title>Images with loading='lazy' load when in the viewport</title>
+  <link rel="author" title="Scott Little" href=""
+  <link rel="help" href=""
+  <script src=""
+  <script src=""
+</head>
+
+<!--
+Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
+-->
+
+<script>
+  const t = async_test("Test that images with loading='lazy' load once they enter the viewport.");
+
+  let has_in_viewport_loaded = false;
+  let has_window_loaded = false;
+
+  const in_viewport_img_onload = t.step_func(function() {
+    assert_false(has_in_viewport_loaded, "The in_viewport element should load only once.");
+    has_in_viewport_loaded = true;
+  });
+
+  window.addEventListener("load", t.step_func(function() {
+    assert_true(has_in_viewport_loaded, "The in_viewport element should have loaded before window.load().");
+    assert_false(has_window_loaded, "The window.load() event should only fire once.");
+    has_window_loaded = true;
+    document.getElementById("below_viewport").scrollIntoView();
+  }));
+
+  const below_viewport_img_onload = t.step_func_done(function() {
+    assert_true(has_window_loaded, "The window.load() event should have fired before below_viewport loaded.");
+  });
+</script>
+
+<body>
+  <img id="in_viewport" src="" loading="lazy" _onload_="in_viewport_img_onload();">
+  <div style="height:10000px;"></div>
+  <img id="below_viewport" src="" loading="lazy" _onload_="below_viewport_img_onload();">
+
+  <!--
+    This async script loads very slowly in order to ensure that, if the
+    below_viewport element has started loading, it has a chance to finish
+    loading before window.load() happens, so that the test will dependably fail
+    in that case instead of potentially passing depending on how long different
+    resource fetches take.
+  -->
+  <script async src=""
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png


(Binary files differ)
Index: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png =================================================================== --- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png 2019-08-08 06:22:58 UTC (rev 248403) +++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png 2019-08-08 08:20:41 UTC (rev 248404) Property changes on: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png ___________________________________________________________________

Added: svn:mime-type

+image/png \ No newline at end of property

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/subframe.html (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/subframe.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/subframe.html	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<body>
+  <p>Subframe</p>
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/w3c-import.log (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/w3c-import.log	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/w3c-import.log	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+	https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/image.png
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/resources/subframe.html

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/w3c-import.log (0 => 248404)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/w3c-import.log	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/w3c-import.log	2019-08-08 08:20:41 UTC (rev 248404)
@@ -0,0 +1,20 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+	https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-eager.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html

Modified: trunk/Tools/ChangeLog (248403 => 248404)


--- trunk/Tools/ChangeLog	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/Tools/ChangeLog	2019-08-08 08:20:41 UTC (rev 248404)
@@ -1,3 +1,17 @@
+2019-08-08  Rob Buis  <[email protected]>
+
+        Import lazy loading WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=199795
+
+        Reviewed by Darin Adler.
+
+        Only do loading/ exception for WebKit specific, non WPT tests.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (shouldLogFrameLoadDelegates):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::TestInvocation):
+
 2019-08-07  Fujii Hironori  <[email protected]>
 
         [Win][MiniBrowser] Add key accelerators for reload and close window

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (248403 => 248404)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-08-08 08:20:41 UTC (rev 248404)
@@ -1802,7 +1802,7 @@
 
 static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
 {
-    return strstr(pathOrURL, "loading/");
+    return strstr(pathOrURL, "loading/") && !strstr(pathOrURL, "://localhost");
 }
 
 static bool shouldLogHistoryDelegates(const char* pathOrURL)

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (248403 => 248404)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2019-08-08 06:22:58 UTC (rev 248403)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2019-08-08 08:20:41 UTC (rev 248404)
@@ -83,7 +83,7 @@
     m_urlString = String(urlVector.data(), stringLength);
 
     // FIXME: Avoid mutating the setting via a test directory like this.
-    m_dumpFrameLoadCallbacks = urlContains("loading/");
+    m_dumpFrameLoadCallbacks = urlContains("loading/") && !urlContains("://localhost");
 }
 
 TestInvocation::~TestInvocation()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to