Bug 21948 - Change two layout tests to work with Chrome's 'file' url policy.
Summary: Change two layout tests to work with Chrome's 'file' url policy.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-29 11:10 PDT by Feng Qian
Modified: 2008-12-17 13:42 PST (History)
2 users (show)

See Also:


Attachments
changes in the test (1.05 KB, patch)
2008-10-29 11:11 PDT, Feng Qian
ap: review+
Details | Formatted Diff | Diff
patch for another test (517 bytes, patch)
2008-10-29 14:39 PDT, Feng Qian
ap: review+
Details | Formatted Diff | Diff
a merge patch with changelog (2.48 KB, patch)
2008-10-29 17:10 PDT, Feng Qian
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Qian 2008-10-29 11:10:09 PDT
The test relies on the fact that file URL scan send XHR requests to any URL.
Chrome is going to have a tighter policy that file url can only send XHR requests to file URLs.

The test needs some changes to accommodate both Safari and Chrome's policies.

Instead of sending an XHR request to http://localhost (which is not existing), the test can send an XHR to the URL itself.
Comment 1 Feng Qian 2008-10-29 11:11:16 PDT
Created attachment 24749 [details]
changes in the test
Comment 2 Alexey Proskuryakov 2008-10-29 12:00:48 PDT
Comment on attachment 24749 [details]
changes in the test

r=me

I presume the test now works in Firefox, too?
Comment 3 Feng Qian 2008-10-29 13:15:43 PDT
The test is failing in FF for different reasons.

Before the change, the test failed because it throws an exception: NS_ERROR_ILLEGAL_VALUE, ex.code is undefined.

After the change, the test failed because no exception is thrown.

(In reply to comment #2)
> (From update of attachment 24749 [details] [edit])
> r=me
> 
> I presume the test now works in Firefox, too?
> 

Comment 4 Feng Qian 2008-10-29 14:39:39 PDT
Created attachment 24755 [details]
patch for another test

Another test has a similar issue. It sends XHR request to 'about:blank'. It is allowed in Safari if the source URL is a file URL. Chrome does not allow it.

The test is testing something else, so make it send URL to itself.
Comment 5 Alexey Proskuryakov 2008-10-29 14:48:12 PDT
Comment on attachment 24755 [details]
patch for another test

r=me

You may need to make these patches easier to land (correct bug title, add ChangeLogs, possibly merge patches into one) - or to find a committer who is willing to do this for you.
Comment 6 Feng Qian 2008-10-29 17:10:35 PDT
Created attachment 24762 [details]
a merge patch with changelog

This is a merged patch with changelog, it is easier for commit.
Comment 7 Alexey Proskuryakov 2008-10-29 23:04:08 PDT
Comment on attachment 24762 [details]
a merge patch with changelog

r=me
Comment 8 Adam Barth 2008-12-17 11:24:43 PST
Will land.
Comment 9 Adam Barth 2008-12-17 13:42:01 PST
LayoutTests/ChangeLog: locally modified
LayoutTests/fast/dom/null-document-xmlhttprequest-open.html: locally modified
LayoutTests/fast/dom/xmlhttprequest-invalid-values.html: locally modified
	M	LayoutTests/ChangeLog
	M	LayoutTests/fast/dom/null-document-xmlhttprequest-open.html
	M	LayoutTests/fast/dom/xmlhttprequest-invalid-values.html
Committed r39365
	M	LayoutTests/ChangeLog
	M	LayoutTests/fast/dom/xmlhttprequest-invalid-values.html
	M	LayoutTests/fast/dom/null-document-xmlhttprequest-open.html
r39365 = d0786620de79c0565e62411bd46561ebdb5df15a (trunk)