Refine http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 23:03:02 +0000 (23:03 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 23:03:02 +0000 (23:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153140

Reviewed by Alexey Proskuryakov.

* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html:
* http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html:
* http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js:
(onload):
(navigation): Deleted.
The reason why the tests are not completed after calling testRunner.notifyDone() is that the original navigation()
is bound as the onload of the iframe which will dispatch two load events. Therefore, navigation() will be called
twice. Here, change the navigation() to be bound with the main frame's onload function, which will restrict it to
be called only once.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html
LayoutTests/http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js

index 1299d95..1446a44 100644 (file)
@@ -1,3 +1,26 @@
+2016-01-15  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Refine http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer*
+        https://bugs.webkit.org/show_bug.cgi?id=153140
+
+        Reviewed by Alexey Proskuryakov.
+
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html:
+        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html:
+        * http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js:
+        (onload):
+        (navigation): Deleted.
+        The reason why the tests are not completed after calling testRunner.notifyDone() is that the original navigation()
+        is bound as the onload of the iframe which will dispatch two load events. Therefore, navigation() will be called
+        twice. Here, change the navigation() to be bound with the main frame's onload function, which will restrict it to
+        be called only once.
+
 2016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [Cocoa] Font features are not applied to the system font
index ef71805..65a64fe 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=always" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=always"></iframe>
index 1cb50a4..7a96de0 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=default" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=default"></iframe>
index 29833e4..481204d 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=never" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=never"></iframe>
index be3c915..3a216bf 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer-when-downgrade" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer-when-downgrade"></iframe>
index 7fe5c19..53064ce 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer"></iframe>
index 72bca14..b72e178 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=origin" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php?referrer=origin"></iframe>
index 1be1476..00ef947 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php?referrer=unsafe-url" onload="navigation()"></iframe>
\ No newline at end of file
+<iframe src="resources/referer-header-stripped-frame.php?referrer=unsafe-url"></iframe>
index 9f134b7..3c2618d 100644 (file)
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <script src="resources/referer-header-stripped.js"></script>
 <p>This test verifies that a link redirected by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
-<iframe src="resources/referer-header-stripped-frame.php" onload="navigation()"></iframe>
+<iframe src="resources/referer-header-stripped-frame.php"></iframe>
index 8a4ecc6..c645c17 100644 (file)
@@ -7,7 +7,7 @@ if (window.testRunner) {
     testRunner.waitUntilDone();
 }
 
-function navigation() {
+onload = function() {
     // Due to the sandbox, it's not possible to run script in the iframe or even access its contentDocument.
     var element = document.getElementsByTagName("iframe")[0];
     var x = element.offsetLeft + 10;