RESOLVED FIXED 210863
Add layout test to validate the User-Agent HTTP header of XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=210863
Summary Add layout test to validate the User-Agent HTTP header of XMLHttpRequest
Chris Dumez
Reported 2020-04-22 10:17:45 PDT
Add layout test to validate the User-Agent HTTP header of XMLHttpRequest.
Attachments
Patch (3.21 KB, patch)
2020-04-22 10:22 PDT, Chris Dumez
no flags
Patch (3.61 KB, patch)
2020-04-22 10:23 PDT, Chris Dumez
no flags
Patch (3.31 KB, patch)
2020-04-22 10:24 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-04-22 10:22:14 PDT
Chris Dumez
Comment 2 2020-04-22 10:23:12 PDT
Chris Dumez
Comment 3 2020-04-22 10:24:35 PDT
youenn fablet
Comment 4 2020-04-22 10:38:28 PDT
Comment on attachment 397219 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397219&action=review > LayoutTests/http/tests/xmlhttprequest/xhr-user-agent.html:16 > + shouldBeTrue("syncXHRUserAgent.includes('AppleWebKit/')"); Is it working for non apple port? Should we use testRunner.setCustomUserAgent?
Chris Dumez
Comment 5 2020-04-22 10:40:41 PDT
(In reply to youenn fablet from comment #4) > Comment on attachment 397219 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=397219&action=review > > > LayoutTests/http/tests/xmlhttprequest/xhr-user-agent.html:16 > > + shouldBeTrue("syncXHRUserAgent.includes('AppleWebKit/')"); > > Is it working for non apple port? > Should we use testRunner.setCustomUserAgent? glib and win ports seem to include "AppleWebKit/" too based on code inspection.
Chris Dumez
Comment 6 2020-04-22 10:42:32 PDT
(In reply to Chris Dumez from comment #5) > (In reply to youenn fablet from comment #4) > > Comment on attachment 397219 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=397219&action=review > > > > > LayoutTests/http/tests/xmlhttprequest/xhr-user-agent.html:16 > > > + shouldBeTrue("syncXHRUserAgent.includes('AppleWebKit/')"); > > > > Is it working for non apple port? > > Should we use testRunner.setCustomUserAgent? > > glib and win ports seem to include "AppleWebKit/" too based on code > inspection. Existing tests already have this expectation: LayoutTests/fast/dom/navigator-userAgent-frozen.html: var start = userAgent.indexOf("AppleWebKit/"); LayoutTests/fast/dom/navigator-userAgent.html: document.write("User Agent should contain AppleWebKit: " + (userAgent.indexOf("AppleWebKit") >= 0) + "<br>"); LayoutTests/http/tests/navigation/useragent.php: var userAgentTemplate = "Mozilla/5.0 (%Platform%%Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko)" LayoutTests/http/tests/navigation/useragent.php: var userAgentTemplateRegExp = /^Mozilla\/5\.0 \(([^;]+; )*[^;]+\) AppleWebKit\/[0-9\.]+(\+)? \(KHTML, like Gecko\).*$/;
EWS
Comment 7 2020-04-22 11:59:43 PDT
Committed r260526: <https://trac.webkit.org/changeset/260526> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397219 [details].
Radar WebKit Bug Importer
Comment 8 2020-04-22 12:00:23 PDT
Note You need to log in before you can comment on or make changes to this bug.