Changeset 195151 in webkit


Ignore:
Timestamp:
Jan 15, 2016 3:03:02 PM (8 years ago)
Author:
jiewen_tan@apple.com
Message:

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.

Location:
trunk/LayoutTests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195150 r195151  
     12016-01-15  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Refine http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer*
     4        https://bugs.webkit.org/show_bug.cgi?id=153140
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html:
     9        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html:
     10        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html:
     11        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html:
     12        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html:
     13        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html:
     14        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html:
     15        * http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html:
     16        * http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js:
     17        (onload):
     18        (navigation): Deleted.
     19        The reason why the tests are not completed after calling testRunner.notifyDone() is that the original navigation()
     20        is bound as the onload of the iframe which will dispatch two load events. Therefore, navigation() will be called
     21        twice. Here, change the navigation() to be bound with the main frame's onload function, which will restrict it to
     22        be called only once.
     23
    1242016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
    225
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=always" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=always"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=default" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=default"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=never" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=never"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer-when-downgrade" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer-when-downgrade"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=no-referrer"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=origin" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=origin"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php?referrer=unsafe-url" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php?referrer=unsafe-url"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html

    r194128 r195151  
    22<script src="resources/referer-header-stripped.js"></script>
    33<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>
    4 <iframe src="resources/referer-header-stripped-frame.php" onload="navigation()"></iframe>
     4<iframe src="resources/referer-header-stripped-frame.php"></iframe>
  • trunk/LayoutTests/http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js

    r194128 r195151  
    88}
    99
    10 function navigation() {
     10onload = function() {
    1111    // Due to the sandbox, it's not possible to run script in the iframe or even access its contentDocument.
    1212    var element = document.getElementsByTagName("iframe")[0];
Note: See TracChangeset for help on using the changeset viewer.