Changeset 33353

Show
Ignore:
Timestamp:
05/12/08 23:05:45 (6 months ago)
Author:
mrowe@apple.com
Message:

o2008-05-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Added this test to demonstrate that, for "f(x)", it is correct to evaluate
"x" even if "f" is not a function, and therefore "f(x)" will throw an exception.

  • fast/js/function-argument-evaluation-before-exception-expected.txt: Added.
  • fast/js/function-argument-evaluation-before-exception.html: Added.

These tests now have an extra "access denied" message in them, because
of the behavior change mentioned above.

I also added try/catch clauses to eliminate the "is not object"
exception messages from the test output.

  • http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-shortcut.html:
  • http/tests/security/listener/resources/targetChild-XMLHttpRequest-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-XMLHttpRequest-shortcut.html:
  • http/tests/security/listener/resources/targetChild-window-onclick-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-window-onclick-shortcut.html:
  • http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
  • http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
Location:
branches/squirrelfish/LayoutTests
Files:
2 added
13 modified

Legend:

Unmodified
Added
Removed
  • branches/squirrelfish/LayoutTests/ChangeLog

    r33352 r33353  
     1o2008-05-07  Geoffrey Garen  <ggaren@apple.com> 
     2 
     3        Reviewed by Oliver Hunt. 
     4 
     5        Added this test to demonstrate that, for "f(x)", it is correct to evaluate 
     6        "x" even if "f" is not a function, and therefore "f(x)" will throw an exception. 
     7 
     8        * fast/js/function-argument-evaluation-before-exception-expected.txt: Added. 
     9        * fast/js/function-argument-evaluation-before-exception.html: Added. 
     10         
     11        These tests now have an extra "access denied" message in them, because 
     12        of the behavior change mentioned above. 
     13         
     14        I also added try/catch clauses to eliminate the "is not object" 
     15        exception messages from the test output. 
     16         
     17        * http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-addEventListener.html: 
     18        * http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-shortcut.html: 
     19        * http/tests/security/listener/resources/targetChild-XMLHttpRequest-addEventListener.html: 
     20        * http/tests/security/listener/resources/targetChild-XMLHttpRequest-shortcut.html: 
     21        * http/tests/security/listener/resources/targetChild-window-onclick-addEventListener.html: 
     22        * http/tests/security/listener/resources/targetChild-window-onclick-shortcut.html: 
     23        * http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt: 
     24        * http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt: 
     25        * http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt: 
     26        * http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt: 
     27        * http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt: 
     28        * http/tests/security/listener/xss-window-onclick-shortcut-expected.txt: 
     29 
    1302008-05-07  Geoffrey Garen  <ggaren@apple.com> 
    231 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-addEventListener.html

    r25249 r33353  
    44    <script> 
    55        window.parent.frames[1].document.getElementById('button').addEventListener("click", function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        }, false); 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-shortcut.html

    r25249 r33353  
    44    <script> 
    55        window.parent.frames[1].document.getElementById('button').onclick = function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        } 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-XMLHttpRequest-addEventListener.html

    r25284 r33353  
    44    <script> 
    55        window.parent.frames[1].XHR.addEventListener("load", function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        }, false); 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-XMLHttpRequest-shortcut.html

    r25284 r33353  
    44    <script> 
    55        window.parent.frames[1].XHR.onreadystatechange = function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        } 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-window-onclick-addEventListener.html

    r25249 r33353  
    44    <script> 
    55        window.parent.frames[1].addEventListener("click", function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        }, false); 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/resources/targetChild-window-onclick-shortcut.html

    r25249 r33353  
    44    <script> 
    55        window.parent.frames[1].onclick = function() { 
    6             alert("document.domain: " + window.document.domain); 
     6            try { 
     7                alert("document.domain: " + window.document.domain); 
     8            } catch(e) { 
     9            } 
    710        } 
    811 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-JSTargetNode-onclick-addEventListener.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWithButton.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on an EventTarget using addEventListener is the target nodes frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-JSTargetNode-onclick-shortcut.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWithButton.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on an EventTarget with the shortcut (onclick, etc), is the target nodes frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-XMLHttpRequest-addEventListener.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWithXMLHttpRequest.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on an XMLHttpRequest using addEventListener, is the requests frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-XMLHttpRequest-shortcut.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWithXMLHttpRequest.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on an XMLHttpRequest with the shortcut (onreadystatechange), is the requests frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-window-onclick-addEventListener.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWindow.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on the window using addEventListener is the window's frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56 
  • branches/squirrelfish/LayoutTests/http/tests/security/listener/xss-window-onclick-shortcut-expected.txt

    r32791 r33353  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/targetChild-window-onclick-shortcut.html. Domains, protocols and ports must match. 
    22 
    3 CONSOLE MESSAGE: line 6: Value undefined (result of expression alert) is not object. 
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe.html from frame with URL http://127.0.0.1:8000/security/listener/resources/childWindow.html. Domains, protocols and ports must match. 
     4 
    45This tests that frame used when setting eventListeners on the window with the shortcut (onclick, etc), is the window's frame. (rdar://problem/5426142). This test passes if you don't see an alert dialog with the domain of "localhost" in it and an "Unsafe JavaScript" warning is logged to the console. 
    56