Add layout test to validate the User-Agent HTTP header of XMLHttpRequest.
Created attachment 397217 [details] Patch
Created attachment 397218 [details] Patch
Created attachment 397219 [details] Patch
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?
(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.
(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\).*$/;
Committed r260526: <https://trac.webkit.org/changeset/260526> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397219 [details].
<rdar://problem/62201273>