Summary: | Add layout test to validate the User-Agent HTTP header of XMLHttpRequest | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
Component: | Tools / Tests | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | darin, rwlbuis, webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 209587 | ||||||||||
Attachments: |
|
Description
Chris Dumez
2020-04-22 10:17:45 PDT
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]. |