Implement Document.referrer

This commit is contained in:
Nazım Can Altınova 2016-07-12 23:29:22 +03:00
parent 9e010a8aec
commit d6c1f7b5e3
17 changed files with 55 additions and 32 deletions

View file

@ -3,9 +3,6 @@
[domain]
expected: FAIL
[referrer]
expected: FAIL
[readyState]
expected: FAIL

View file

@ -3,9 +3,6 @@
[Document interface: attribute domain]
expected: FAIL
[Document interface: attribute referrer]
expected: FAIL
[Document interface: attribute dir]
expected: FAIL
@ -6990,9 +6987,6 @@
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "enableStyleSheetsForSet" with the proper type (33)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "referrer" with the proper type (36)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "dir" with the proper type (42)]
expected: FAIL
@ -7350,9 +7344,6 @@
[Document interface: new Document() must have own property "location"]
expected: FAIL
[Document interface: new Document() must inherit property "referrer" with the proper type (36)]
expected: FAIL
[Document interface: new Document() must inherit property "dir" with the proper type (42)]
expected: FAIL

View file

@ -105,11 +105,10 @@ function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) {
// Check the reported URL.
test.step(function() {
// TODO - can uncomment when Document::Referrer is implemented
// assert_equals(result.referrer,
// t._expectedReferrerUrl,
// "Reported Referrer URL is '" +
// t._scenario.referrer_url + "'.");
assert_equals(result.referrer,
t._expectedReferrerUrl,
"Reported Referrer URL is '" +
t._scenario.referrer_url + "'.");
assert_equals(result.headers.referer,
t._expectedReferrerUrl,
"Reported Referrer URL from HTTP header is '" +

View file

@ -16,7 +16,7 @@
return(false);
}
var referrer = 'referrer' in document ? document.referrer : undefined;
var referrer = document.referrer.length > 0 ? document.referrer : undefined;
var result = {
location: document.location.toString(),