Changeset 258649 in webkit
- Timestamp:
- Mar 18, 2020 10:57:45 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258640 r258649 1 2020-03-18 Chris Dumez <cdumez@apple.com> 2 3 [ Mac wk2 ] http/wpt/beacon/beacon-quota.html is flaky failing 4 https://bugs.webkit.org/show_bug.cgi?id=207894 5 <rdar://problem/59551688> 6 7 Reviewed by Geoffrey Garen. 8 9 Update test to address flakiness and unskip it. 10 11 * http/wpt/beacon/beacon-quota-expected.txt: 12 * http/wpt/beacon/beacon-quota.html: 13 * platform/mac-wk2/TestExpectations: 14 1 15 2020-03-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 16 -
trunk/LayoutTests/http/wpt/beacon/beacon-quota-expected.txt
r220946 r258649 1 CONSOLE MESSAGE: line 44: Beacon API cannot load http://localhost:8800/. Reached maximum amount of queued data of 64Kb for keepalive requests2 CONSOLE MESSAGE: line 52: Beacon API cannot load http://localhost:8800/. Reached maximum amount of queued data of 64Kb for keepalive requests1 CONSOLE MESSAGE: line 30: Beacon API cannot load http://localhost:8800/. Reached maximum amount of queued data of 64Kb for keepalive requests 2 CONSOLE MESSAGE: line 39: Beacon API cannot load http://localhost:8800/. Reached maximum amount of queued data of 64Kb for keepalive requests 3 3 4 4 PASS Beacon with a body above the Quota Limit should fail. -
trunk/LayoutTests/http/wpt/beacon/beacon-quota.html
r220946 r258649 9 9 var expectedQuota = 65536; 10 10 11 function checkBeaconReceived(id)11 function waitForBeaconCompletion() 12 12 { 13 13 return new Promise(function(resolve, reject) { 14 var checkUrl = RESOURCES_DIR + "beacon-preflight.py?cmd=get&id=" + id; 15 fetch(checkUrl).then(response => { 16 response.json().then(result => { 17 resolve(result['beacon'] == 1); 18 }); 19 }, reject); 20 }); 21 } 22 23 function waitForBeacon(id) 24 { 25 return new Promise(function(resolve, reject) { 26 checkBeaconReceived(id).then(wasReceived => { 27 if (wasReceived) { 28 resolve(); 29 return; 30 } 31 setTimeout(function() { 32 waitForBeacon(id).then(resolve, reject); 33 }, 10); 34 }); 14 if (!internals.inflightBeaconsCount) { 15 resolve(); 16 return; 17 } 18 setTimeout(function() { 19 waitForBeaconCompletion().then(resolve, reject); 20 }, 10); 35 21 }); 36 22 } … … 50 36 51 37 assert_true(navigator.sendBeacon(target, createPayload(expectedQuota)), "Beacon with a body at the Quota Limit should succeed."); 38 assert_equals(internals.inflightBeaconsCount, 1); 52 39 assert_false(navigator.sendBeacon("/", createPayload(1)), "Second beacon should not be sent because we reached the quota"); 53 return waitForBeacon (id).then(function() {40 return waitForBeaconCompletion().then(function() { 54 41 assert_true(navigator.sendBeacon(target, createPayload(1)), "Allocated quota should be returned once the beacon is no longer in flight"); 55 42 }); -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r258585 r258649 1046 1046 webkit.org/b/207864 webgpu/whlsl/do-while-loop-continue.html [ Pass ImageOnlyFailure ] 1047 1047 1048 webkit.org/b/207894 http/wpt/beacon/beacon-quota.html [ Pass Failure ]1049 1050 1048 webkit.org/b/207938 http/wpt/crypto/derive-hmac-key-crash.any.html [ Pass Crash ] 1051 1049 -
trunk/Source/WebCore/ChangeLog
r258648 r258649 1 2020-03-18 Chris Dumez <cdumez@apple.com> 2 3 [ Mac wk2 ] http/wpt/beacon/beacon-quota.html is flaky failing 4 https://bugs.webkit.org/show_bug.cgi?id=207894 5 <rdar://problem/59551688> 6 7 Reviewed by Geoffrey Garen. 8 9 Add internals API exposing the number of inflight beacon loads for a given navigator object 10 so that the test can rely on it. 11 12 * Modules/beacon/NavigatorBeacon.h: 13 * testing/Internals.cpp: 14 (WebCore::Internals::inflightBeaconsCount const): 15 * testing/Internals.h: 16 * testing/Internals.idl: 17 1 18 2020-03-18 Frederic Wang <fwang@igalia.com> 2 19 -
trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.h
r241183 r258649 47 47 static ExceptionOr<bool> sendBeacon(Navigator&, Document&, const String& url, Optional<FetchBody::Init>&&); 48 48 49 size_t inflightBeaconsCount() const { return m_inflightBeacons.size(); } 50 51 WEBCORE_EXPORT static NavigatorBeacon* from(Navigator&); 52 49 53 private: 50 54 ExceptionOr<bool> sendBeacon(Document&, const String& url, Optional<FetchBody::Init>&&); 51 55 52 static NavigatorBeacon* from(Navigator&);53 56 static const char* supplementName(); 54 57 -
trunk/Source/WebCore/testing/Internals.cpp
r258635 r258649 134 134 #include "MockPageOverlay.h" 135 135 #include "MockPageOverlayClient.h" 136 #include "NavigatorBeacon.h" 136 137 #include "NavigatorMediaDevices.h" 137 138 #include "NetworkLoadInformation.h" … … 638 639 } 639 640 641 unsigned Internals::inflightBeaconsCount() const 642 { 643 auto* document = contextDocument(); 644 if (!document) 645 return 0; 646 647 auto* window = document->domWindow(); 648 if (!window) 649 return 0; 650 651 auto* navigator = window->optionalNavigator(); 652 if (!navigator) 653 return 0; 654 655 return NavigatorBeacon::from(*navigator)->inflightBeaconsCount(); 656 } 657 640 658 unsigned Internals::workerThreadCount() const 641 659 { -
trunk/Source/WebCore/testing/Internals.h
r258587 r258649 658 658 void simulateSystemWake() const; 659 659 660 unsigned inflightBeaconsCount() const; 661 660 662 enum class PageOverlayType { View, Document }; 661 663 ExceptionOr<Ref<MockPageOverlay>> installMockPageOverlay(PageOverlayType); -
trunk/Source/WebCore/testing/Internals.idl
r258587 r258649 240 240 [MayThrowException] unsigned long lastSpatialNavigationCandidateCount(); 241 241 242 readonly attribute unsigned long inflightBeaconsCount; 243 242 244 // CSS Animation testing. 243 245 unsigned long numberOfActiveAnimations();
Note: See TracChangeset
for help on using the changeset viewer.