diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/old-tests/submission/Microsoft | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/old-tests/submission/Microsoft')
113 files changed, 4347 insertions, 0 deletions
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_000-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_000-manual.htm new file mode 100644 index 000000000..278157644 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_000-manual.htm @@ -0,0 +1,62 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire drag event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire drag event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "drag"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire drag event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Click and drag the blue image + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the user agent is still performing the previous iteration of the sequence (if any) when the next iteration becomes due, abort these steps for this iteration (effectively "skipping missed frames" of the drag-and-drop operation). + Fire a DND event named drag event at the source node. If this event is canceled, the user agent must set the current drag operation to "none" (no drag operation). + </p> + <img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target"/> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_001-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_001-manual.htm new file mode 100644 index 000000000..3514f2193 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_001-manual.htm @@ -0,0 +1,62 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire drag event when dragging a div element</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire drag event when dragging a div element"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "drag"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire drag event when dragging a div element</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Click and drag the red box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the user agent is still performing the previous iteration of the sequence (if any) when the next iteration becomes due, abort these steps for this iteration (effectively "skipping missed frames" of the drag-and-drop operation). + Fire a DND event named drag event at the source node. If this event is canceled, the user agent must set the current drag operation to "none" (no drag operation). + </p> + <div id="target" style="border:2px red solid; width:200px; height:50px" draggable="true"></div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_002-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_002-manual.htm new file mode 100644 index 000000000..fdd40b577 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_002-manual.htm @@ -0,0 +1,64 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire dragend event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire dragend event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragendEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "dragend"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragendEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire dragend event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Drag the blue image + <li> Drop it on the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the drag operation failed or succeeded, fire a DND event named dragend at the source node. + </p> + <img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target"/> + <br /><br /> + <input type="text" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_003-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_003-manual.htm new file mode 100644 index 000000000..bde48b9cc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_003-manual.htm @@ -0,0 +1,67 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire dragenter event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire dragenter event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragenterEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "dragenter"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragenterEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire dragenter event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Select the text inside the red box + <li> Drag it and enter the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the user is indicating a different immediate user selection than during the last iteration (or if this is the first iteration), and if this immediate user selection is not the same as the current target element, then update the current target element as follows: + - If the new immediate user selection is null, Set the current target element to null also. + - If the new immediate user selection is in a non-DOM document or application, Set the current target element to the immediate user selection. + - Otherwise, Fire a DND event named dragenter at the immediate user selection. + </p> + <div style="border:2px red solid; width:200px; height:50px">SampleText</div> + <br /><br /> + <input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_004-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_004-manual.htm new file mode 100644 index 000000000..c97cc7dbf --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_004-manual.htm @@ -0,0 +1,19 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Auto state of draggable attribute for 'a' element</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/> + <meta name="assert" content="Auto state of draggable attribute for 'a' element"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <a href="#" style="display:none" id="target">Drag this</a> + <script type="text/javascript"> + test(function() {assert_true(document.getElementById("target").draggable)}, "Auto state of draggable attribute for 'a' element"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_005-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_005-manual.htm new file mode 100644 index 000000000..28305cd26 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_005-manual.htm @@ -0,0 +1,19 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Auto state of draggable attribute for div element</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/> + <meta name="assert" content="Auto state of draggable attribute for div element"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <div style="border:2px red solid; width:200px; height:50px; display:none;" id="target">SampleText</div> + <script type="text/javascript"> + test(function() {assert_false(document.getElementById("target").draggable)}, "Auto state of draggable attribute for div element"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_006-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_006-manual.htm new file mode 100644 index 000000000..4d8432b07 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_006-manual.htm @@ -0,0 +1,19 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Auto state of draggable attribute for img element</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/> + <meta name="assert" content="Auto state of draggable attribute for img element"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <img style="width:200px; height:100px; display:none;" id="target"/> + <script type="text/javascript"> + test(function() {assert_true(document.getElementById("target").draggable)}, "Auto state of draggable attribute for img element"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_007-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_007-manual.htm new file mode 100644 index 000000000..f14c70b39 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_007-manual.htm @@ -0,0 +1,19 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: False state of draggable attribute</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/> + <meta name="assert" content="False state of draggable attribute"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <a href="#" style="display:none" id="target" draggable="false">Drag this</a> + <script type="text/javascript"> + test(function() {assert_false(document.getElementById("target").draggable)}, "False state of draggable attribute"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_008-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_008-manual.htm new file mode 100644 index 000000000..4716e5188 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_008-manual.htm @@ -0,0 +1,19 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: True state of draggable attribute</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/> + <meta name="assert" content="True state of draggable attribute"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <a href="#" style="display:none" id="target" draggable="true">Drag this</a> + <script type="text/javascript"> + test(function() {assert_true(document.getElementById("target").draggable)}, "True state of draggable attribute"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_009-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_009-manual.htm new file mode 100644 index 000000000..781a58476 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_009-manual.htm @@ -0,0 +1,66 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire dragleave event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire dragleave event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragleaveEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "dragleave"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragleaveEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire dragleave event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Select the text inside the red box + <li> Drag it over the blue box and drop it on the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If there is a change in the current target element, and if the previous target element was not null or a part of a non-DOM document, then fire a DND event named dragleave at the previous target element. + </p> + <div style="border:2px red solid; width:100px">SampleText</div> + <br /> + <div id="target" style="border:2px blue solid; width:200px; height:50px"></div> + <br /> + <input type="text" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_010-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_010-manual.htm new file mode 100644 index 000000000..08e0a071e --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_010-manual.htm @@ -0,0 +1,64 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire dragover event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire dragover event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragoverEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "dragover"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragoverEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire dragover event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Select the text inside the red box. + <li> Drag it, hover over the green box and then release the mouse + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the current target element is a DOM element, then fire a DND event named dragover at this current target element + </p> + <div style="border:2px red solid; width:100px">SampleText</div> + <br /><br /> + <div id="target" style="border:2px green solid; width:200px; height:100px"></div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_011-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_011-manual.htm new file mode 100644 index 000000000..dcd7c9c9d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_011-manual.htm @@ -0,0 +1,62 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire dragstart event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire dragstart event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DragstartEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "dragstart"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DragstartEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire dragstart event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Click and drag the red box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If it is an element that is being dragged, then set the drag data store elements list to contain just the source node. + Fire a DND event named dragstart at the source node. + </p> + <div id="target" style="border:2px red solid; width:200px; height:50px" draggable="true"></div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_012-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_012-manual.htm new file mode 100644 index 000000000..b1df40a70 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_012-manual.htm @@ -0,0 +1,64 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Fire drop event during the drag and drop processing</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/> + <meta name="assert" content="Fire drop event during the drag and drop processing"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DropEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "drop"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DropEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: Fire drop event during the drag and drop processing</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Select the text inside the red box + <li> Drag it and drop it on the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model + </p> + <p> + If the drag operation was a success, if the current target element is a DOM element, fire a DND event named drop at it. + </p> + <div style="border:2px red solid; width:100px">SampleText</div> + <br /><br /> + <input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_013-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_013-manual.htm new file mode 100644 index 000000000..6c2c88afc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_013-manual.htm @@ -0,0 +1,76 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Set a value to effectAllowed attribute</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/> + <meta name="assert" content="Set a value to effectAllowed attribute"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var TARGETEVENT1, TARGETEVENT2, TARGET1, TARGET2; + + function DragstartEvent(evt) + { + if ((TARGET1 == evt.target) && (TARGETEVENT1 == evt.type)) + { + evt.dataTransfer.effectAllowed = "move"; + } + } + function DragenterEvent(evt) + { + if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type)) + { + if("move" == evt.dataTransfer.effectAllowed) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + } + + TARGETEVENT1 = "dragstart"; + TARGETEVENT2 = "dragenter"; + + window.onload = function() + { + TARGET1 = document.getElementById("target1"); + TARGET2 = document.getElementById("target2"); + AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1); + AddEventListenersForElement(TARGETEVENT2, DragenterEvent, false, TARGET2); + } + </script> + </head> + <body> + <pre>Description: Set a value to effectAllowed attribute</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Drag the blue image and enter the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#datatransfer + </p> + <p> + On setting, if the new value is one of "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", or "uninitialized", then the attribute's current value must be set to the new value. + </p> + <img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target1"/> + <br /><br /> + <input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_014-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_014-manual.htm new file mode 100644 index 000000000..3959cd2ee --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_014-manual.htm @@ -0,0 +1,81 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: files attribute returns a FileList</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/> + <meta name="assert" content="files attribute returns a FileList"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DropEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + var files = evt.dataTransfer.files; + if(('[object FileList]' == files)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + else + { + LogTestResult("FAIL"); + } + } + + function DragenterEvent(evt) + { + evt.preventDefault(); + } + + function DragoverEvent(evt) + { + evt.preventDefault(); + } + + EVENT = "drop"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DropEvent, false, TARGET); + AddEventListenersForElement("dragenter", DragenterEvent, false, TARGET); + AddEventListenersForElement("dragover", DragoverEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: files attribute returns a FileList</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Drag a file and drop it in the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#datatransfer + </p> + <p> + The files attribute must return a live FileList sequence consisting of File objects representing the files. + </p> + <textarea type="text" id="target" style="border:2px green solid; width:200px; height:50px"></textarea> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_015-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_015-manual.htm new file mode 100644 index 000000000..1cd64d945 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_015-manual.htm @@ -0,0 +1,78 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: Add an item to the drag data store item list whose data is the string given by setData method's second argument</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/> + <meta name="assert" content="Add an item to the drag data store item list whose data is the string given by setData method's second argument"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var TARGETEVENT1, TARGETEVENT2, TARGET1, TARGET2; + + function DragstartEvent(evt) + { + if ((TARGET1 == evt.target) && (TARGETEVENT1 == evt.type)) + { + evt.dataTransfer.setData("text", "SetText"); + } + } + function DropEvent(evt) + { + if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type)) + { + if("SetText" == evt.dataTransfer.getData("text")) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + } + + TARGETEVENT1 = "dragstart"; + TARGETEVENT2 = "drop"; + + window.onload = function() + { + TARGET1 = document.getElementById("target1"); + TARGET2 = document.getElementById("target2"); + AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1); + AddEventListenersForElement(TARGETEVENT2, DropEvent, false, TARGET2); + } + </script> + </head> + <body> + <pre>Description: Add an item to the drag data store item list whose data is the string given by setData method's second argument</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Drag the blue image and drop it in the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#datatransfer + </p> + <p> + If format equals "text", change it to "text/plain". + Remove the item in the drag data store item list whose kind is Plain Unicode string and whose type string is equal to format, if there is one. + Add an item to the drag data store item list whose kind is Plain Unicode string, whose type string is equal to format, and whose data is the string given by the method's second argument. + </p> + <img src="../images/blue.png" style="width:200px; height:100px" draggable="customValue2" id="target1"/> + <br /><br /> + <input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_016-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_016-manual.htm new file mode 100644 index 000000000..26b3317c3 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_016-manual.htm @@ -0,0 +1,72 @@ +<!doctype html> +<html> + <head> + <title>HTML5 Drag and Drop: types attribute returns a DOMStringList</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> + <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/> + <meta name="assert" content="types attribute returns a DOMStringList"/> + <script src="dragdrop_support.js" type="text/javascript"></script> + <script type="text/javascript"> + var EVENT, TARGET; + + function DropEvent(evt) + { + if ((TARGET == evt.target) && (EVENT == evt.type)) + { + var types = evt.dataTransfer.types; + if(('[object DOMStringList]' == types)) + { + LogTestResult("PASS"); + } + else + { + LogTestResult("FAIL"); + } + } + else + { + LogTestResult("FAIL"); + } + } + + EVENT = "drop"; + + window.onload = function() + { + TARGET = document.getElementById("target"); + AddEventListenersForElement(EVENT, DropEvent, false, TARGET); + } + </script> + </head> + <body> + <pre>Description: types attribute returns a DOMStringList</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_result'>Manual</td> + <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below. + <div id="manualsteps"> + Steps: + <ol> + <li> Select the text inside the red box + <li> Drag and drop it in the green box + </ol> + </div> + </td> + </tr> + </table> + <p> + http://dev.w3.org/html5/spec/dnd.html#datatransfer + </p> + <p> + The types attribute must return a live DOMStringList. + </p> + <div style="border:2px red solid; width:200px; height:50px">SampleText</div> + <br /><br /> + <input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_support.js b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_support.js new file mode 100644 index 000000000..f5a1d6417 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/dragdrop/dragdrop_support.js @@ -0,0 +1,9 @@ +function AddEventListenersForElement(evt, callback, capture, element) +{ + element.addEventListener(evt, callback, capture); +} + +function LogTestResult(result) +{ + document.getElementById("test_result").firstChild.data = result; +} diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_002.html b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_002.html new file mode 100644 index 000000000..47acacfe7 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_002.html @@ -0,0 +1,47 @@ +<!DOCTYPE html > +<html> + <head> + <title>HTML 5 Foreign Content SVG in HTML </title> + <meta description="Test to verify SVG inside HTML I element parses correctly" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <script type="text/javascript"> + + function RunTest() + { + try + { + + if(document.getElementsByTagName("i")[0].childNodes[1].localName=="svg") + { + var svgNamespace = "http://www.w3.org/2000/svg"; + var textElem = document.createElementNS(svgNamespace, "text"); + + var textContent = document.createTextNode("FillerText"); + textElem.appendChild(textContent); + + var container = document.getElementById("svg1"); + container.appendChild(textElem); + + } + } + catch(ex) + { + } + } + </script> + </head> + + <body onLoad="RunTest()"> + + <div class="testdata"> + <p id="instructions">Test passes if 'FillerText' is rendered as italic.</p> + </div> + <div> + <i> + <svg id="svg1" width="100px" height="100px"> + </svg> + </i> + </div> + + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_007.html b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_007.html new file mode 100644 index 000000000..f1ba496bb --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_007.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<svg width="100px" height="100px" > + <rect width="100px" height="100px" fill="green" /> +</svg> + +<div> + <p> Test passes if a green rectangle is visible on the page above this line. </p> +</div> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_012.html b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_012.html new file mode 100644 index 000000000..09e99e41a --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_012.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTML 5 Foreign Content SVG in HTML </title> + <meta description="Test to verify SVG elements are styled using SCRIPT and STYLE element" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + + <style> + svg + { + display: block; + fill: black; + } + </style> + <script> + function ChangeColor() + { + document.getElementById("rect1").style.fill = "green"; + } + </script> + </head> + + <body onload="ChangeColor()"> + + <div class="testdata"> + <p id="instructions">Test passes if a green square appears above a black square. </p> + </div> + <svg width="200px" height="200px"> + <rect id="rect1" x="0" y="0" width="100px" height="100px" /> + <rect id="rect2" x="0" y="150" width="100px" height="100px" /> + </svg> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_014.html b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_014.html new file mode 100644 index 000000000..d92c14dfa --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_014.html @@ -0,0 +1,98 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTML 5 Foreign Content SVG in HTML </title> + <meta description="Test to verify SVG elements inside SVG namespace are camelCased" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + + <script type="text/javascript"> + + function RunTest() + { + try + { + var bResult = "FAIL"; + var parentNode = document.getElementById("svg1"); + + for(var i=1;i<parentNode.childNodes.length;i=i+2) + { + var idName = parentNode.childNodes[i].id; + var tagName = parentNode.childNodes[i].localName; + if(idName!=tagName) + { + bResult = "FAIL"; + break; + } + else + { + bResult = "PASS" + } + } + } + catch(ex) + { + bResult = "PASS"; + } + + document.getElementById("testresult").innerHTML = bResult; + } + </script> + </head> + + <body onload="RunTest()"> + + <div class="testdata"> + <p id="instructions"> Test passes if the word "PASS" appears below </p> + <p> Test Result : </p> + <p id="testresult"> RUNNING </div> + </div> + <svg id="svg1"> + + <altglyph id="altGlyph" /> + <ALTGLYPHDEF id="altGlyphDef" /> + <AltGlyphItem id="altGlyphItem" /> + <animatecolor id="animateColor" /> + <animatemotion id="animateMotion" /> + <animatetransform id="animateTransform" /> + <clippath id="clipPath" /> + <feblend id="feBlend" /> + <fecolormatrix id="feColorMatrix" /> + + <fecomponenttransfer id="feComponentTransfer" /> + <fecomposite id="feComposite" /> + <feconvolvematrix id="feConvolveMatrix" /> + <fediffuselighting id="feDiffuseLighting" /> + <fedisplacementmap id="feDisplacementMap" /> + <fedistantlight id="feDistantLight" /> + <feflood id="feFlood" /> + <fefunca id="feFuncA" /> + <fefuncb id="feFuncB" /> + + <fefuncg id="feFuncG" /> + <fefuncr id="feFuncR" /> + <fegaussianblur id="feGaussianBlur" /> + <feimage id="feImage" /> + <femerge id="feMerge" /> + <femergenode id="feMergeNode" /> + <femorphology id="feMorphology" /> + <feoffset id="feOffset" /> + <fepointlight id="fePointLight" /> + + <fespecularlighting id="feSpecularLighting" /> + <fespotlight id="feSpotLight" /> + <fetile id="feTile" /> + <feturbulence id="feTurbulence" /> + <foreignobject id="foreignObject" /> + <glyphref id="glyphRef" /> + <lineargradient id="linearGradient" /> + <radialgradient id="radialGradient" /> + <textpath id="textPath" /> + + </svg> + + + + </body> + +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_015.html b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_015.html new file mode 100644 index 000000000..a4d27873a --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/foreigncontent/foreign_content_015.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTML 5 Foreign Content SVG in HTML </title> + <meta description="Test to verify SVG Elements outside SVG namespace are camelCased" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + + <script type="text/javascript"> + + function RunTest() + { + try + { + + var parentNode = document.getElementById("div1"); + + for(var i=0;i<parentNode.childNodes.length;i++) + { + var idName = parentNode.childNodes[i].id; + var tagName = parentNode.childNodes[i].localName; + if(idName==tagName) + { + document.getElementById("testresult").innerHTML = "FAIL"; + break; + } + else + { + document.getElementById("testresult").innerHTML = "PASS"; + } + } + } + catch(ex) + { + document.getElementById("testresult").innerHTML = "FAIL"; + } + } + </script> + </head> + + <body onload="RunTest()"> + + <div id="div1"> + <AlTglYph id="altGlyph" /> + </div> + <p id="instructions"> Test passes if the word "PASS" appears below </p> + <p> Test Result : </p> + <div id="testresult"> RUNNING </div> + + + </body> + +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/history/404.html b/testing/web-platform/tests/old-tests/submission/Microsoft/history/404.html new file mode 100644 index 000000000..e28f5c575 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/history/404.html @@ -0,0 +1 @@ +Page Not Found
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/history/history_000.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/history/history_000.htm new file mode 100644 index 000000000..03a36bd5f --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/history/history_000.htm @@ -0,0 +1,329 @@ +<!doctype html> +<html> + <head> + <meta content="text/html; charset=utf-8" http-equiv="content-type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/history.html" /> + <title>HTML5 History Test Cases</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> +<body> + <div id="log"></div> + + <!-- Use this iframe to test url changes so that the base url does not change. Their document does not matter. --> + <iframe id="testframe1" style="display:none" src="./404.html"></iframe> + <iframe id="testframe2" style="display:none" src="./404.html"></iframe> + + <script type="text/javascript"> + var testCollection; + var testIndex = 0; + var testframe1 = document.getElementById("testframe1"); + var testframe2 = document.getElementById("testframe2"); + + setup(function() + { + testCollection = [ + function() { + test(function() { + assert_inherits(window, "onpopstate", "window inherits'onpopstate' event "); + }, "onpopstate in window"); + }, + function() { + test(function() { + assert_inherits(window.history, "pushState", "history inherits property 'pushState'"); + assert_equals(window.history.pushState.constructor, Function, "pushState is a function"); + }, "history.pushState is present"); + }, + function() { + test(function() { + assert_inherits(window.history, "replaceState", "history inherits property 'replaceState'"); + assert_equals(window.history.replaceState.constructor, Function, "replaceState is a function"); + }, "history.replaceState is present"); + }, + function() { + test(function() { + assert_inherits(window.history, "state", "history inherits property 'state'"); + }, "history.state is present"); + }, + function() { + test(function() { + assert_equals(window.history.state, null, "history.state initialized to null"); + }, "history.state is initialized to null"); + }, + + function() { + test(function() { + var length = history.length; + history.pushState(null,null); + assert_equals(history.length, length+1, "history.length should be incremented by one"); + }, "history.pushState increments history.length"); + }, + + function() { + var t = async_test("history.pushState clears forward entries"); + t.step(function() { + var length = history.length; + //push some extra entries into the session history + history.pushState(null,null); + history.pushState(null, null); + history.pushState(null, null); + + //there should now be three extra + assert_equals(history.length, length+3, "Three additional travel entries add to history.length"); + + //travel back to the entry that the test started on + history.back(); + history.back(); + history.back(); + + //if the back navs are queued, queue verification task after them + queue( + t.step_func(function() { + //once the .back navigations have completed, push again and verify length is one more than starting value + history.pushState(null, null); + assert_equals(history.length, length+1, "History.length should now only be one more than original value"); + t.done(); + }) + ); + }); + }, + + function() { + test(function() { + testframe1.contentWindow.history.pushState(null,null, "test-pushstate-url"); + assert_equals(getPageName(testframe1.contentWindow.location.href), "test-pushstate-url", "iframe1 has the pushed url"); + }, "history.pushState accepts a third parameter 'url' and uses it to alter location"); + }, + function() { + test(function() { + var oldurl = testframe1.contentWindow.location.href.toString(); + var pagename = getPageName(oldurl); + //form a new absolute url (with protocol, host, etc) with "absolute-page" as the name of the page + var newurl = oldurl.replace(pagename, "absolute-page"); + + testframe1.contentWindow.history.pushState(null,null, newurl); + assert_equals(testframe1.contentWindow.location.href, newurl, "iframe1 has the pushed url correctly"); + }, "history.pushState's url parameter can be an absolute url"); + }, + + function() { + test(function() { + testframe1.contentWindow.history.pushState(null,null, "multiple-pushstate-url1"); + testframe2.contentWindow.history.pushState(null,null, "multiple-pushstate-url2"); + + assert_equals(getPageName(testframe1.contentWindow.location.href), "multiple-pushstate-url1", "iframe1 has the pushed url"); + assert_equals(getPageName(testframe2.contentWindow.location.href), "multiple-pushstate-url2", "iframe2 has the pushed url"); + }, "history.pushState can modify location object in multiple frames"); + }, + + function() { + test(function() { + //trigger a security error by replacing the host of the current url with a fake one that is cross-domain + var testurl = testframe1.contentWindow.location.href.toString().replace(testframe1.contentWindow.location.host, "fakelocation-push"); + assert_throws("SECURITY_ERR", function() { history.pushState(null, null, testurl); }, "Security_Err 18 should be thrown"); + }, "history.pushState throws DOMException with code SECURITY_ERR (18)"); + }, + + function() { + test(function() { + //trigger a data clone error by passing invalid SCA data into the function + assert_throws("DATA_CLONE_ERR", function() { history.pushState(document.body, null); }, "pushState should throw an exception DATA_CLONE_ERR with code 25"); + }, "history.pushState throws DATA_CLONE_ERR(25) for bad state parameter"); + }, + + function() { + test(function() { + var length = history.length; + history.replaceState(null,null); + assert_equals(history.length, length, "history.length should not change"); + }, "history.replaceState does not increment history.length"); + }, + + function() { + var t = async_test("history.replaceState does not clear forward entries"); + t.step(function() { + var length = history.length; + //push some extra entries into the session history + history.pushState(null,null); + history.pushState(null, null); + history.pushState(null, null); + + //there should now be three extra + assert_equals(history.length, length+3, "Three additional travel entries add to history.length"); + + //travel back two entries to land in the middle + history.back(); + history.back(); + + //if the back navs are queued, queue verification task after them + queue( + t.step_func(function() { + //once the .back navigations have fired, push again and verify length has not changed since the last check + history.replaceState(null, null); + assert_equals(history.length, length+3, "History.length should still be three more than original value"); + t.done(); + }) + ); + }); + }, + + function() { + test(function() { + testframe1.contentWindow.history.replaceState(null,null, "test-replaceState-url"); + assert_equals(getPageName(testframe1.contentWindow.location.href), "test-replaceState-url", "iframe1 has the pushed url"); + }, "history.replaceState accepts a third parameter 'url' and uses it to alter location"); + }, + function() { + test(function() { + var oldurl = testframe1.contentWindow.location.href.toString(); + var pagename = getPageName(oldurl); + //form a new absolute url (with protocol, host, etc) with "absolute-page" as the name of the page + var newurl = oldurl.replace(pagename, "absolute-page"); + + testframe1.contentWindow.history.replaceState(null,null, newurl); + assert_equals(testframe1.contentWindow.location.href, newurl, "iframe1 has the pushed url correctly"); + }, "history.replaceState's url parameter can be an absolute url"); + }, + + function() { + test(function() { + testframe1.contentWindow.history.replaceState(null,null, "multiple-replaceState-url1"); + testframe2.contentWindow.history.replaceState(null,null, "multiple-replaceState-url2"); + + assert_equals(getPageName(testframe1.contentWindow.location.href), "multiple-replaceState-url1", "iframe1 has the pushed url"); + assert_equals(getPageName(testframe2.contentWindow.location.href), "multiple-replaceState-url2", "iframe2 has the pushed url"); + }, "history.replaceState can modify location object in multiple frames"); + }, + + function() { + test(function() { + //trigger a security error by replacing the host of the current url with a fake one that is cross-domain + var testurl = testframe1.contentWindow.location.href.toString().replace(testframe1.contentWindow.location.host, "fakelocation-replace"); + assert_throws("SECURITY_ERR", function() { history.replaceState(null, null, testurl); }, "Security_Err 18 should be thrown"); + }, "history.replaceState throws DOMException with code SECURITY_ERR (18)"); + }, + + function() { + test(function() { + //trigger a data clone error by passing invalid SCA data into the function + assert_throws("DATA_CLONE_ERR", function() {history.replaceState(document.body, null);}, "replaceState should throw an exception DATA_CLONE_ERR with code 25"); + }, "history.replaceState throws DATA_CLONE_ERR(25) for bad state parameter"); + }, + + function() { + var t = async_test("PopStateEvent fires on Back navigation"); + t.step(function() { + history.pushState(null, null); + history.pushState(null, null); + //prepare to end the test as soon as popstate fires + onpopstate = function(e) { + t.done(); + } + //go back to fire the popstate event + history.back(); + }); + }, + + function() { + var t = async_test("PopStateEvent fires on Forward navigation"); + t.step( function() { + onpopstate = null; + history.pushState(null, null); + history.pushState(null, null); + history.back(); + //if the back navigation is queued, set up the rest of the test after it is done + queue( + t.step_func(function() { + //prepare to end the test as soon as popstate fires + onpopstate = function(e) { + t.done(); + } + //go forward to fire the popstate event + history.forward(); + }) + ); + }); + }, + + function() { + var t = async_test("PopStateEvent receives state data on Back navigation"); + t.step(function() { + history.pushState("popstate-data", null); + history.pushState(null, null); + //prepare the popstate event to validate the data + onpopstate = t.step_func(function(e) { + assert_equals(e.state, "popstate-data", "State data is passed to the event correctly"); + t.done(); + }); + //go back to fire the popstate event + history.back(); + }); + }, + + function() { + test(function() { + history.pushState("pushstate-data", null); + //history.state should be set immediately + assert_equals(history.state, "pushstate-data", "State data is set correctly"); + }, "history.state is set by history.pushState"); + }, + + function() { + test(function() { + history.replaceState("replacestate-data", null); + //history.state should be set immediately + assert_equals(history.state, "replacestate-data", "State data is set correctly"); + }, "history.state is set by history.replaceState"); + }, + + function() { + var t = async_test("history.state changes on navigation"); + t.step(function() { + history.pushState("state-back1", null); + history.pushState("state-back2", null); + //precondition + assert_equals(history.state, "state-back2", "Verify that history.state is set to a second value"); + + //set up the popstate event to verify that history.state was changed + onpopstate = t.step_func(function(e) { + assert_equals(e.state, "state-back1", "Verify that history.state reverted to the first value"); + t.done(); + }); + history.back(); + }); + }, + ]; + }, {explicit_done:true, timeout:8000}); + + //used to get the name of a page within a path + // to check correctness of url parameter + function getPageName(path) { + var path = path || location.pathname; + var segments = path.split('/'); + return segments[segments.length-1]; + } + + //Callback for result_callback + //queues the next test in the array testCollection + //serves to make test execution sequential despite asynchronous behaviors + function testFinished(test) { + if(testIndex < testCollection.length - 1) { + //queue the function so that stack remains shallow + queue(testCollection[++testIndex]); + } else { + //when the last test has run, explicitly end test suite + done(); + } + } + function queue(func) { + //50 allows adequate time for .back and .forward navigations to queue first + setTimeout(func, 50); + } + + add_result_callback(testFinished); + //start the first test manually + queue(testCollection[testIndex]); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-area.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-area.png Binary files differnew file mode 100644 index 000000000..570ae0f2b --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-area.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-border.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-border.png Binary files differnew file mode 100644 index 000000000..8f8e41c3d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue-border.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue.png Binary files differnew file mode 100644 index 000000000..4498dd258 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/blue.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/fail.gif b/testing/web-platform/tests/old-tests/submission/Microsoft/images/fail.gif Binary files differnew file mode 100644 index 000000000..c4addcf00 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/fail.gif diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/movie_300_frame_0.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/movie_300_frame_0.png Binary files differnew file mode 100644 index 000000000..b71282509 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/movie_300_frame_0.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster.png Binary files differnew file mode 100644 index 000000000..8873ed678 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_blue.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_blue.png Binary files differnew file mode 100644 index 000000000..69d5a39dc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_blue.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_green.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_green.png Binary files differnew file mode 100644 index 000000000..cac16ede7 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_green.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_red.png b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_red.png Binary files differnew file mode 100644 index 000000000..0fb1f252c --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/poster_red.png diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/images/rect.svg b/testing/web-platform/tests/old-tests/submission/Microsoft/images/rect.svg new file mode 100644 index 000000000..bb0cf97d9 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/images/rect.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="svg-root" width="100" height="50"> + <rect width="100" height="50" fill="black" /> +</svg> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_001.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_001.htm new file mode 100644 index 000000000..24d16cfcc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_001.htm @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with script</title> +</head> +<body> + <script type="text/javascript"> + parent.window.postMessage("script ran", "*"); + </script> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_002.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_002.htm new file mode 100644 index 000000000..e63784771 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_002.htm @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 video with autoplay attribute.</title> + <script src="/common/media.js"></script> +</head> +<body> + <script> + function do_play(event) { + parent.window.postMessage("play event fired", "*"); + } + + document.write( + "<video id='video0' src='" + getVideoURI("/media/green-at-15") + "'" + + " autoplay onplay='do_play(event);'>" + ); + </script> + Your browser does not support HTML5 video. + </video> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_003.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_003.htm new file mode 100644 index 000000000..621ece79a --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_003.htm @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> + <title>autofocus on form control</title> +</head> +<body> + <div>Below form control has autofocus attribute set.</div><br /> + <form action=""> + <span>Textbox: </span><input autofocus="autofocus" type="text" name="movie" /> + </form> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_004.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_004.htm new file mode 100644 index 000000000..02960d078 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_004.htm @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<head> + <title>object tag</title> +</head> +<body> + <object width="400" height="600" data="sandbox.pdf"> + </object> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_006.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_006.htm new file mode 100644 index 000000000..42542ae14 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_006.htm @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<title>Form submission</title> +</head> +<body> + <form id="form1" action="standalone-pass.htm"> + <span>Name: </span><input type="text" name="name" value="browser" /><br /> + <input id="submitButton" type="submit" value="Submit Form" /> + </form> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_007.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_007.htm new file mode 100644 index 000000000..fc01557c7 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_007.htm @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<title>Form submission</title> +</head> +<body> + <form id="form1" action="standalone-fail.htm"> + <span>Name: </span><input type="text" name="name" value="browser" /><br /> + <input id="submitButton" type="submit" value="Submit Form" /> + </form> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_008.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_008.htm new file mode 100644 index 000000000..115b97293 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_008.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with hyperlink and target set to self</title> +</head> +<body> + <a id="hyperlink" href="standalone-pass.htm" target="_self">Click here to perform self navigation</a> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_009.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_009.htm new file mode 100644 index 000000000..f232dcb7c --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_009.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with showModalDialog() API</title> +</head> +<body> + <button type="button" onclick="javascript:showModalDialog('standalone-fail.htm')">Click here to call showModalDialog() API</button> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_010.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_010.htm new file mode 100644 index 000000000..d4e81bb96 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_010.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with window.open()</title> +</head> +<body> + <button type="button" onclick="javascript:window.open('standalone-fail.htm')">Click here to call window.open() API</button> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_012.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_012.htm new file mode 100644 index 000000000..b1e8f92fb --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_012.htm @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with access to document.cookie</title> +</head> +<body> + <script type="text/javascript"> + cookie = document.cookie; + document.cookie = "name=browser"; + parent.window.postMessage("cookies are R/W", "*"); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020.htm new file mode 100644 index 000000000..3304ea84b --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020.htm @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with iframes</title> +</head> +<body> + <table cellpadding="5" cellspacing="10"> + <tr> + <td> + <span>child iframe with sandbox="allow-scripts" attribute</span><br /> + <iframe id="Iframe1" src="iframe_sandbox_020a.htm" sandbox="allow-scripts" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + <tr> + <td> + <span>child iframe with sandbox="" attribute</span><br /> + <iframe id="Iframe2" src="iframe_sandbox_020a.htm" sandbox="" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + <tr> + <td> + <span>child iframe without sandbox attribute</span><br /> + <iframe id="Iframe3" src="iframe_sandbox_020a.htm" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + </table> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020a.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020a.htm new file mode 100644 index 000000000..a419c9413 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_020a.htm @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with script</title> +</head> +<body> + <div>Script Execution: <span id="scriptExecute" style="Color: Green">Blocked</span></div> + <script type="text/javascript"> + document.getElementById("scriptExecute").innerHTML = "Not Blocked"; + document.getElementById("scriptExecute").style.color = "Red"; + </script> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021.htm new file mode 100644 index 000000000..e3041ccef --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021.htm @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with iframes</title> +</head> +<body> + <table cellpadding="5" cellspacing="10"> + <tr> + <td> + <span>child iframe with sandbox="allow-scripts" attribute</span><br /> + <iframe id="Iframe1" src="iframe_sandbox_021a.htm" sandbox="allow-scripts" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + <tr> + <td> + <span>child iframe with sandbox="" attribute</span><br /> + <iframe id="Iframe2" src="iframe_sandbox_020a.htm" sandbox="" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + <tr> + <td> + <span>child iframe without sandbox attribute</span><br /> + <iframe id="Iframe3" src="iframe_sandbox_021a.htm" style="height: 50px; width: 250px;"></iframe> + </td> + </tr> + </table> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021a.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021a.htm new file mode 100644 index 000000000..4e22a363c --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_021a.htm @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with script</title> +</head> +<body> + <div>Script Execution: <span id="scriptExecute" style="Color: Red">Blocked</span></div> + <script type="text/javascript"> + document.getElementById("scriptExecute").innerHTML = "Allowed"; + document.getElementById("scriptExecute").style.color = "Green"; + </script> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_022.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_022.htm new file mode 100644 index 000000000..11382d1d7 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_022.htm @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> +<head> + <title>target=_top</title> +</head> +<body> + <div>hyperlink with target=_top</div> + <br /> + <a href="standalone-pass.htm" target="_top">Open the link in top window</a> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_023.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_023.htm new file mode 100644 index 000000000..a65db539b --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_023.htm @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head><title>Access parent dom</title> +</head> +<body> + <script type="text/javascript"> + if (window.parent.document) + { + parent.window.postMessage("window.parent.document", "*"); + }else{ + parent.window.postMessage("!window.parent.document", "*"); + } + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_024.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_024.htm new file mode 100644 index 000000000..1b0996e58 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_024.htm @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> +<head><title>Page with access to document.cookie</title> +</head> +<body> + <div>Cookie Read: <span id="readCookie"></span></div> + <script type="text/javascript"> + cookie = document.cookie; + document.cookie = "name=browser"; + parent.window.postMessage("cookies are R/W", "*"); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_026.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_026.htm new file mode 100644 index 000000000..5f1a973e1 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_026.htm @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head><title>Page with access to localStorage and sessionStorage</title> +</head> +<body> + <script type="text/javascript"> + if (window.localStorage && window.sessionStorage) { + parent.window.postMessage("access to window.localStorage and window.sessionStorage", "*"); + } + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_027.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_027.htm new file mode 100644 index 000000000..366bff6f9 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_027.htm @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head><title>XMLHttpRequest</title> +</head> +<body> + <script type="text/javascript"> + xhrRequest = new XMLHttpRequest(); + + xhrRequest.onreadystatechange = function () { + if (xhrRequest.readyState == 4 && xhrRequest.status == 200) { + //xhr successful + parent.window.postMessage("access to window.XMLHttpRequest", "*"); + } + } + + xhrRequest.open("GET", "standalone-pass.htm", true); + xhrRequest.send(); + + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_028.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_028.htm new file mode 100644 index 000000000..d7ca76144 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_028.htm @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head><title>Access parent dom</title> +</head> +<body> + <script type="text/javascript"> + try + { + if (window.parent.document) + { + parent.window.postMessage("window.parent.document", "*"); + } + } + catch(e) + { + parent.window.postMessage("!window.parent.document", "*"); + } + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_029.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_029.htm new file mode 100644 index 000000000..5d5c720bd --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_029.htm @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head><title>Page with access to document.cookie</title> +</head> +<body> + <div>Cookie Read: <span id="readCookie"></span></div> + <script type="text/javascript"> + try + { + cookie = document.cookie; + document.cookie = "name=browser"; + parent.window.postMessage("cookies are R/W", "*"); + }catch(e) + { + parent.window.postMessage("cookies are not R/W", "*"); + } + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_031.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_031.htm new file mode 100644 index 000000000..7ec7d7a4e --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_031.htm @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head><title>Page with access to localStorage and sessionStorage</title> +</head> +<body> + <script type="text/javascript"> + try + { + if (window.localStorage && window.sessionStorage) { + parent.window.postMessage("access to window.localStorage and window.sessionStorage", "*"); + } + } + catch(e) + { + parent.window.postMessage("no access to window.localStorage and window.sessionStorage", "*"); + } + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_032.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_032.htm new file mode 100644 index 000000000..abc0370c2 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/iframe_sandbox_032.htm @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> +<head><title>XMLHttpRequest</title> +</head> +<body> + <script type="text/javascript"> + + try + { + xhrRequest = new XMLHttpRequest(); + + xhrRequest.onreadystatechange = function () { + if (xhrRequest.readyState == 4 && xhrRequest.status == 200) { + //xhr successful + parent.window.postMessage("access to window.XMLHttpRequest", "*"); + } + } + + xhrRequest.open("GET", "standalone-pass.htm", true); + xhrRequest.send(); + + }catch(e){} + + parent.window.postMessage("no access to window.XMLHttpRequest", "*"); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox.pdf b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox.pdf Binary files differnew file mode 100644 index 000000000..0e16bc8d9 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox.pdf diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_001.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_001.htm new file mode 100644 index 000000000..53e2172bc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_001.htm @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Allow script execution inside iframe with sandbox attribute when sandbox="allow-scripts".</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-scripts-browsing-context-flag" /> + <meta name="assert" content="Allow script execution inside iframe with sandbox attribute when sandbox='allow-scripts'." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Allow script execution inside iframe with sandbox attribute when sandbox='allow-scripts'."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "script ran"); + }); + t.done(); + } + + var timer = setTimeout(callback, 8000); + window.addEventListener("message", callback, false); + </script> + <iframe src="iframe_sandbox_001.htm" sandbox="allow-scripts" style="display: none"></iframe> + <div id=log></div> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_002.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_002.htm new file mode 100644 index 000000000..767518456 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_002.htm @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Allow autoplay for HTML5 Video inside iframe with sandbox attribute if sandbox='allow-scripts'.</title> + <meta name=timeout content=long> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script> + async_test(function (t) { + var callback = t.step_func_done(function(event) { + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "play event fired"); + }); + + window.addEventListener("message", callback, false); + }, "Allow autoplay for HTML5 Video inside iframe with sandbox attribute if sandbox='allow-scripts'."); + </script> + <iframe src="iframe_sandbox_002.htm" sandbox="allow-scripts" style="display: none"></iframe> + <div id=log></div> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_003-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_003-manual.htm new file mode 100644 index 000000000..21078322b --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_003-manual.htm @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block autofocus on form control inside iframe with sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-automatic-features-browsing-context-flag" /> + <meta name="assert" content="Block autofocus on form control inside iframe with sandbox attribute." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Block autofocus on form controls inside iframe with sandbox attribute.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'>Test passes if caret (text cursor) is not on the textbox in the below iframe.</td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox</pre> + <iframe src="iframe_sandbox_003.htm" sandbox style="height: 100px; width: 400px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_004-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_004-manual.htm new file mode 100644 index 000000000..21b063aed --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_004-manual.htm @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block plugins inside iframe with sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-plugins-browsing-context-flag" /> + <meta name="assert" content="Block plugins inside iframe with sandbox attribute." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Block plugins inside iframe with sandbox attribute.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'>Test passes if you DO NOT see the 'Sample PDF For Testing' pdf below or 'FAIL'.<br> + Test requires that a pdf plugin has been installed!</td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox</pre> + <iframe sandbox src="iframe_sandbox_004.htm" height="400" width ="600"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_005.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_005.htm new file mode 100644 index 000000000..cc5f815c9 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_005.htm @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block script execution inside iframe with sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-scripts-browsing-context-flag" /> + <meta name="assert" content="Block script execution inside iframe with sandbox attribute." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Block script execution inside iframe with sandbox attribute."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_true(!event); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <iframe src="iframe_sandbox_001.htm" sandbox style="display: none"></iframe> + <div id=log></div> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_006-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_006-manual.htm new file mode 100644 index 000000000..487e8d4cf --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_006-manual.htm @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Allow form submission inside sandbox iframe when sandbox='allow-forms'</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-forms-browsing-context-flag" /> + <meta name="assert" content="Allow form submission inside sandbox iframe when sandbox='allow-forms'." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Allow form submission inside iframe with sandbox attribute if sandbox='allow-forms'.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click button "Submit Form".</div> + <br /> + <div>Test passes if there is no red on the page and if the word "PASS" appears in the below iframe after following the above steps.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox="allow-forms"</pre> + <iframe src="iframe_sandbox_006.htm" sandbox="allow-forms" style="height: 100px; width: 300px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_007-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_007-manual.htm new file mode 100644 index 000000000..5caa12a07 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_007-manual.htm @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Block form submission inside sandbox iframe</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-forms-browsing-context-flag" /> + <meta name="assert" content="Block form submission inside sandbox iframe." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Block form submission inside iframe with sandbox attribute.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click button "Submit Form".</div> + <br /> + <div>Test passes if there is no red on the page and there is no navigation in the below iframe after following the above steps.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox="allow-scripts allow-same-origin allow-top-navigation"</pre> + <iframe src="iframe_sandbox_007.htm" sandbox="allow-scripts allow-same-origin allow-top-navigation" style="height: 100px; width: 300px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_008-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_008-manual.htm new file mode 100644 index 000000000..dde12ef1d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_008-manual.htm @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Allow sandboxed iframe content to navigate the sandboxed browsing context itself.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-navigation-browsing-context-flag" /> + <meta name="assert" content="Allow sandboxed iframe content to navigate the sandboxed browsing context itself." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Allow sandboxed iframe content to navigate the sandboxed browsing context itself.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click link "Click here to perform self navigation".</div> + <br /> + <div>Test passes if there is no red on the page and the word "PASS" appears in the below iframe after following the above steps.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox=""</pre> + <iframe id="iframe1" name="iframe1" src="iframe_sandbox_008.htm" sandbox="" style="height: 100px; width: 350px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_009-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_009-manual.htm new file mode 100644 index 000000000..5cb0d9030 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_009-manual.htm @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block popup created via showModalDialog() inside iframe with sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="Block popup created via showModalDialog() inside iframe with sandbox attribute." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Block popup created via showModalDialog() inside iframe with sandbox attribute.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click button "Click here to call showModalDialog() API".</div> + <br /> + <div>Test passes if there is no red on the page and no new window opens. The user agent may offer the user the option of allowing a new window to open.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox="allow-scripts allow-same-origin allow-forms allow-top-navigation"</pre> + <iframe src="iframe_sandbox_009.htm" sandbox="allow-scripts allow-same-origin allow-forms allow-top-navigation" style="height: 100px; width: 450px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_010-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_010-manual.htm new file mode 100644 index 000000000..4341066e1 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_010-manual.htm @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block window.open() API inside iframe with sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-navigation-browsing-context-flag" /> + <meta name="assert" content="Block window.open() API inside iframe with sandbox attribute." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Block window.open() API inside iframe with sandbox attribute.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click button "Click here to call window.open() API".</div> + <br /> + <div>Test passes if there is no red on the page and no new window opens. The user agent may offer the user the option of allowing a new window to open.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox="allow-scripts allow-same-origin allow-forms allow-top-navigation"</pre> + <iframe src="iframe_sandbox_010.htm" sandbox="allow-scripts allow-same-origin allow-forms allow-top-navigation" style="height: 100px; width: 450px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_011.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_011.htm new file mode 100644 index 000000000..ce3ee1a7d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_011.htm @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: iframe sandbox attribute value support DOMTokenList interface.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element" /> + <meta name="assert" content="iframe sandbox attribute value support DOMTokenList interface." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <div id=log></div> + <iframe id="iframe1" src="about:blank" sandbox="allow-scripts allow-same-origin allow-forms" style="display : none"></iframe> + <script type="text/javascript"> + + test(function() { + var iframeEle = document.getElementById("iframe1"); + assert_equals(iframeEle.sandbox.length, 3) + }, "DOMTokenList length") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + assert_equals(iframeEle.sandbox.item(1), "allow-same-origin") + }, "DOMTokenList item(index)") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + assert_true(iframeEle.sandbox.contains("allow-forms")) + }, "DOMTokenList contains(DomString)") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + iframeEle.sandbox.add("ALLOW-SANDBOX"); + assert_true(iframeEle.sandbox.contains("ALLOW-SANDBOX")) + }, "DOMTokenList add(DomString)") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + iframeEle.sandbox.remove("ALLOW-SANDBOX"); + assert_false(iframeEle.sandbox.contains("ALLOW-SANDBOX")) + }, "DOMTokenList remove(DomString)") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + iframeEle.sandbox.remove("ALLOW-SANDBOX"); + assert_true( + iframeEle.sandbox.toggle("allow-top-navigation") && iframeEle.sandbox.contains("allow-top-navigation") && + !iframeEle.sandbox.toggle("allow-top-navigation") && !iframeEle.sandbox.contains("allow-top-navigation") + ) + }, "DOMTokenList toggle(DomString) - Returns true if token is now present (it was added); returns false if it is not (it was removed).") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + assert_equals(iframeEle.sandbox.value, iframeEle.sandbox.toString()) + }, "DOMTokenList sandbox.toString()") + + test(function() { + var iframeEle = document.getElementById("iframe1"); + iframeEle.sandbox.remove("ALLOW-SANDBOX"); + assert_true(iframeEle.sandbox.contains("allow-scripts") != iframeEle.sandbox.contains("Allow-SCRIPTS")) + }, "DOMTokenList case sensitivity") + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_012.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_012.htm new file mode 100644 index 000000000..cf99378cd --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_012.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox=" Allow-Scripts Allow-Same-Origin "></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_013.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_013.htm new file mode 100644 index 000000000..ab0aea079 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_013.htm @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox=" + allow-scripts + allow-same-origin + "></iframe> +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_014.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_014.htm new file mode 100644 index 000000000..774720929 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_014.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox=" allow-scripts allow-same-origin "></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_015.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_015.htm new file mode 100644 index 000000000..a34ede4b3 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_015.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox=" ALLOW-SCRIPTS allow-same-origin "></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_016.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_016.htm new file mode 100644 index 000000000..c84e223e1 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_016.htm @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function() { + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox="
ALLOW-SCRIPTS
allow-same-origin
"></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_017.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_017.htm new file mode 100644 index 000000000..ade4c8092 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_017.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox="ALLOW-SCRIPTSallow-same-origin"></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_018.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_018.htm new file mode 100644 index 000000000..77f10d274 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_018.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox="
ALLOW-SCRIPTS
allow-same-origin
"></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_019.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_019.htm new file mode 100644 index 000000000..d91280a60 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_019.htm @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: value of sandbox attribute must be an unordered set of unique space-separated tokens.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="value of sandbox attribute must be an unordered set of unique space-separated tokens." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("value of sandbox attribute must be an unordered set of unique space-separated tokens."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + + <iframe style="display:none" src="iframe_sandbox_012.htm" sandbox="	ALLOW-SCRIPTS	allow-same-origin	"></iframe> + +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_020-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_020-manual.htm new file mode 100644 index 000000000..751f85863 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_020-manual.htm @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe.</pre> + <div>This test is to verify script is blocked inside nested iframes if the top-most sandbox iframe has no 'allow-scripts' token.</div> + <br /> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'>Test passes if there is no red on the page.</td> + </tr> + </table> + <br /> + <div id="testframe"> + <div style="font-weight:bold">Top-most iframe with sandbox=""</div> + <iframe id="iframe1" name="iframe1" src="iframe_sandbox_020.htm" sandbox="" style="height: 330px; width: 400px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_021-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_021-manual.htm new file mode 100644 index 000000000..bbdc21f93 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_021-manual.htm @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox" /> + <meta name="assert" content="Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Nested iframes cannot have less sandbox restrictions than their most restrictive ancestor iframe.</pre> + <div>This test is to verify script is allowed inside nested iframes if any of the conditions below are true</div> + <div>1. both parent sandbox and child sandbox have 'allow-scripts' token.</div> + <div>2. parent sandbox has 'allow-scripts' token and nested child iframe has no sandbox attribute.</div> + <div>3. parent iframe has no sandbox attribute and child iframe has sandbox='allow-scripts' token.</div> + <div>4. both parent and child iframes have no sandbox attribute.</div> + <br /> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'>Test passes if there is no red on the page.</td> + </tr> + </table> + <br /> + <div id="testframe"> + <div style="float: left; border: 1px solid; padding: 5px;"> + <div style="font-weight: bold">Top-most iframe with sandbox="allow-scripts"</div> + <iframe id="iframe1" src="iframe_sandbox_021.htm" sandbox="allow-scripts" style="height: 330px; width: 400px;"></iframe> + </div> + <div style="float: left; border: 1px solid; padding: 5px; margin-left: 20px;"> + <div style="font-weight: bold">Top-most iframe without sandbox attribute</div> + <iframe id="iframe2" src="iframe_sandbox_021.htm" style="height: 330px; width: 400px;"></iframe> + </div> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_022-manual.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_022-manual.htm new file mode 100644 index 000000000..aa08de512 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_022-manual.htm @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: allow sandbox iframe to navigate their top-level browsing context if sandbox="allow-top-navigation".</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-scripts-browsing-context-flag" /> + <meta name="assert" content="Allow sandbox iframe to navigate their top-level browsing context if sandbox='allow-top-navigation'." /> + <script src="sandbox_helper.js" type="text/javascript"></script> +</head> +<body> + <pre>Description: Allow sandbox iframe to navigate its top-level browsing context if sandbox='allow-top-navigation'.</pre> + <table id='testtable' border='1'> + <tr> + <td>Test Result</td> + <td>Test Assertion</td> + </tr> + <tr> + <td id='test_0_result'>Manual</td> + <td id='test_0_assertion'> + <div>Steps:</div> + <div>1. Click link "Open the link in top window".</div> + <br /> + <div>Test passes if there is no red on the page and no top-level navigation after following the above steps.</div> + </td> + </tr> + </table> + <br /> + <div id="testframe"> + <pre>iframe with sandbox="allow-top-navigation"</pre> + <iframe src="iframe_sandbox_022.htm" sandbox="allow-top-navigation" style="height: 100px; width: 450px;"></iframe> + </div> + <script type="text/javascript"> + DisableTestForNonSupportingBrowsers(); + </script> +</body> +</html> + diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_023.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_023.htm new file mode 100644 index 000000000..7f8a436b4 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_023.htm @@ -0,0 +1,34 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Allow sandbox iframe to access other content from the same origin if sandbox="allow-same-origin".</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content=" Allow sandbox iframe to access other content from the same origin if sandbox='allow-same-origin'." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Allow sandbox iframe to access other content from the same origin if sandbox='allow-same-origin'"); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "window.parent.document"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <iframe src="iframe_sandbox_023.htm" sandbox="allow-scripts allow-same-origin" style="display:none"></iframe> + <div id=log></div> + +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_024.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_024.htm new file mode 100644 index 000000000..935543707 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_024.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: document.cookie access is allowed inside iframe with sandbox="allow-same-origin".</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="document.cookie access is allowed inside iframe with sandbox='allow-same-origin'." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("document.cookie access is allowed inside iframe with sandbox='allow-same-origin'."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_024.htm" sandbox="allow-scripts allow-same-origin" style="display:none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_025.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_025.htm new file mode 100644 index 000000000..ab291e5ce --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_025.htm @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Allow parent content to access sandbox child iframe content when sandbox='allow-same-origin</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Allow parent content to access sandbox child iframe content when sandbox='allow-same-origin'" /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + + var t = async_test("Allow parent content to access sandbox child iframe content when sandbox='allow-same-origin'"); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(document.getElementById('sandboxIframe').contentDocument.title, "Page with a message"); + }); + t.done(); + } + </script> + <div id=log></div> + + <iframe id='sandboxIframe' src="standalone-iframe-content.htm" sandbox="allow-same-origin" onload="callback()" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_026.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_026.htm new file mode 100644 index 000000000..49243899e --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_026.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Allow localStorage and sessionStorage access inside iframe with sandbox='allow-same-origin allow-scripts'.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Allow localStorage and sessionStorage access inside iframe with sandbox='allow-same-origin allow-scripts'." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Allow localStorage and sessionStorage access inside iframe with sandbox='allow-same-origin allow-scripts'"); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "access to window.localStorage and window.sessionStorage"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_026.htm" sandbox="allow-scripts allow-same-origin" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_027.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_027.htm new file mode 100644 index 000000000..2b9cba5d2 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_027.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Allow XMLHttpRequest inside iframe with the sandbox attribute if sandbox='allow-same-origin'.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Allow XMLHttpRequest in an iframe with the sandbox attribute if sandbox='allow-same-origin'." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Allow XMLHttpRequest in an iframe with the sandbox attribute if sandbox='allow-same-origin'."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "access to window.XMLHttpRequest"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_027.htm" sandbox="allow-scripts allow-same-origin" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_028.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_028.htm new file mode 100644 index 000000000..56dfb6810 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_028.htm @@ -0,0 +1,34 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Block sandbox iframe from accessing other content from the same origin.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Block sandbox iframe from accessing other content from the same origin." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Block sandbox iframe from accessing other content from the same origin."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "!window.parent.document"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <iframe src="iframe_sandbox_028.htm" sandbox="allow-scripts" style="display:none"></iframe> + <div id=log></div> + +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_029.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_029.htm new file mode 100644 index 000000000..b88b74a22 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_029.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Block document.cookie inside iframe with the sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Block document.cookie inside iframe with the sandbox attribute." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Block document.cookie inside iframe with the sandbox attribute."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "cookies are not R/W"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_029.htm" sandbox="allow-scripts" style="display:none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_030.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_030.htm new file mode 100644 index 000000000..1c3b54cb0 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_030.htm @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> + <title>HTML5 Sandbox: Block parent content to access sandbox child iframe content when sandbox attribute exists</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Block parent content to access sandbox child iframe content when sandbox attribute exists" /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + + var t = async_test("Block parent content to access sandbox child iframe content when sandbox attribute exists"); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + try { document.getElementById('sandboxIframe').contentDocument.title; assert_true(false);} + catch(e) {assert_true(true);} + }); + t.done(); + } + </script> + <div id=log></div> + + <iframe id='sandboxIframe' src="standalone-iframe-content.htm" sandbox onload="callback()" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_031.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_031.htm new file mode 100644 index 000000000..2582fac35 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_031.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Block localStorage and sessionStorage inside iframe with the sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Block localStorage and sessionStorage inside iframe with the sandbox attribute." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Block localStorage and sessionStorage inside iframe with the sandbox attribute."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "no access to window.localStorage and window.sessionStorage"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_031.htm" sandbox="allow-scripts" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_032.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_032.htm new file mode 100644 index 000000000..1c234fcc9 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_032.htm @@ -0,0 +1,33 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>HTML5 Sandbox: Block XMLHttpRequest in an iframe with the sandbox attribute.</title> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" /> + <meta name="assert" content="Block XMLHttpRequest inside sandbox iframe." /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script type="text/javascript"> + + + var t = async_test("Block XMLHttpRequest in an iframe with the sandbox attribute."); + + function callback(event) + { + t.step(function(){ + assert_true('sandbox' in document.createElement('iframe')); + assert_equals(event.data, "no access to window.XMLHttpRequest"); + }); + t.done(); + } + + var timer = setTimeout(callback, 4000); + window.addEventListener("message", callback, false); + </script> + <div id=log></div> + <iframe src="iframe_sandbox_032.htm" sandbox="allow-scripts" style="display : none"></iframe> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_helper.js b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_helper.js new file mode 100644 index 000000000..1472cbf22 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/sandbox_helper.js @@ -0,0 +1,14 @@ +function IsSandboxSupported() { + if ('sandbox' in document.createElement('iframe')) { + return true; + } + return false; +} + +function DisableTestForNonSupportingBrowsers() { + //check if sandbox is supported by the browser + if (!IsSandboxSupported()) { + document.getElementById('testframe').innerHTML = "FAIL: Your browser does not support the sandbox attribute on the iframe element."; + document.getElementById('testframe').style.color = "Red"; + } +}
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-fail.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-fail.htm new file mode 100644 index 000000000..1725ef060 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-fail.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with FAIL message</title> +</head> +<body> + <div style="color: Red">FAIL!!!</div> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-iframe-content.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-iframe-content.htm new file mode 100644 index 000000000..e543c21d6 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-iframe-content.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with a message</title> +</head> +<body> + <div>Hello World.</div> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-pass.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-pass.htm new file mode 100644 index 000000000..0ca822f8d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/sandbox/standalone-pass.htm @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with PASS message</title> +</head> +<body> + <div style="color: Green">PASS!!!</div> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm new file mode 100644 index 000000000..69150236e --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm @@ -0,0 +1,40 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Remove the element containing the selection</title> + <script type="text/javascript"> + function RunTest() + { + try + { + var selection = window.getSelection(); + var div1 = document.getElementById("div1"); + var span1 = document.getElementById("span1"); + var range = document.createRange(); + range.selectNode(span1); + selection.addRange(range); + + document.body.removeChild(div1); + + if ("" == selection.toString()) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <div id="div1">some text + <span id="span1">aaaaaaaa</span> + </div> + <div id="div2">Remove the element containing the selection</div> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm new file mode 100644 index 000000000..c4b5e9944 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm @@ -0,0 +1,72 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Add a range to the selection</title> + <script type="text/javascript"> + var testPassed = true; + + function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount) + { + var selection = window.getSelection(); + if (anchorNode != selection.anchorNode) + { + testPassed = false; + } + if (anchorOffset != selection.anchorOffset) + { + testPassed = false; + } + if (focusNode != selection.focusNode) + { + testPassed = false; + } + if (focusOffset != selection.focusOffset) + { + testPassed = false; + } + if (collapsed != selection.isCollapsed) + { + testPassed = false; + } + if (rangeCount != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + + checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, range.collapsed, 1); + if (p1.firstChild.nodeValue != selection.toString()) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Add a range to the selection</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm new file mode 100644 index 000000000..7c2423021 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm @@ -0,0 +1,73 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Collapse the selection using collapse()</title> + <script type="text/javascript"> + var testPassed = true; + + function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount) + { + var selection = window.getSelection(); + if (anchorNode != selection.anchorNode) + { + testPassed = false; + } + if (anchorOffset != selection.anchorOffset) + { + testPassed = false; + } + if (focusNode != selection.focusNode) + { + testPassed = false; + } + if (focusOffset != selection.focusOffset) + { + testPassed = false; + } + if (collapsed != selection.isCollapsed) + { + testPassed = false; + } + if (rangeCount != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + selection.collapse(p1, 0); + + checkSelectionAttributes(p1, 0, p1, 0, true, 1); + if ("" != selection.toString()) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Collapse the selection using collapse()</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm new file mode 100644 index 000000000..2f68ec655 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm @@ -0,0 +1,75 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Collapse the selection with collapseToEnd()</title> + <script type="text/javascript"> + var testPassed = true; + + function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount) + { + var selection = window.getSelection(); + if (anchorNode != selection.anchorNode) + { + testPassed = false; + } + if (anchorOffset != selection.anchorOffset) + { + testPassed = false; + } + if (focusNode != selection.focusNode) + { + testPassed = false; + } + if (focusOffset != selection.focusOffset) + { + testPassed = false; + } + if (collapsed != selection.isCollapsed) + { + testPassed = false; + } + if (rangeCount != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + selection.collapseToEnd(); + + range.collapse(false); + + checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1); + if ("" != selection.toString()) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Collapse the selection with collapseToEnd()</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm new file mode 100644 index 000000000..da9676d57 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm @@ -0,0 +1,75 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Collapse the selection with collapseToStart()</title> + <script type="text/javascript"> + var testPassed = true; + + function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount) + { + var selection = window.getSelection(); + if (anchorNode != selection.anchorNode) + { + testPassed = false; + } + if (anchorOffset != selection.anchorOffset) + { + testPassed = false; + } + if (focusNode != selection.focusNode) + { + testPassed = false; + } + if (focusOffset != selection.focusOffset) + { + testPassed = false; + } + if (collapsed != selection.isCollapsed) + { + testPassed = false; + } + if (rangeCount != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + selection.collapseToStart(); + + range.collapse(true); + + checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1); + if ("" != selection.toString()) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Collapse the selection with collapseToStart()</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm new file mode 100644 index 000000000..2373939cc --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm @@ -0,0 +1,80 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Delete some text from the document while it is part of a selection</title> + <script type="text/javascript"> + var testPassed = true; + + function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount) + { + var selection = window.getSelection(); + if (anchorNode != selection.anchorNode) + { + testPassed = false; + } + if (anchorOffset != selection.anchorOffset) + { + testPassed = false; + } + if (focusNode != selection.focusNode) + { + testPassed = false; + } + if (focusOffset != selection.focusOffset) + { + testPassed = false; + } + if (collapsed != selection.isCollapsed) + { + testPassed = false; + } + if (rangeCount != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p2 = document.getElementById("p2"); + var expectedResult = "abcdeuvwxyz"; + + var range = document.createRange(); + range.setStart(p2.firstChild, 5); + range.setEnd(p2.firstChild, 20); + selection.addRange(range); + selection.deleteFromDocument(); + p2.normalize(); + + range.collapse(true); + + checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1); + + if (expectedResult != p2.firstChild.data) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Delete some text from the document while it is part of a selection</p> + <p id="p2">abcdefghijklmnopqrstuvwxyz</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm new file mode 100644 index 000000000..a3911e6cd --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm @@ -0,0 +1,59 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Get the range from the selection</title> + <script type="text/javascript"> + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + var testPassed = true; + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + + var returnedRange = selection.getRangeAt(0); + + if (range.toString() != returnedRange.toString()) + { + testPassed = false; + } + if (range.startContainer != returnedRange.startContainer) + { + testPassed = false; + } + if (range.startOffset != returnedRange.startOffset) + { + testPassed = false; + } + if (range.endContainer != returnedRange.endContainer) + { + testPassed = false; + } + if (range.endOffset != returnedRange.endOffset) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Get the range from the selection</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm new file mode 100644 index 000000000..4ec0d80f3 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm @@ -0,0 +1,41 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Insert a new element and text node into an element that is currently selected</title> + <script type="text/javascript"> + function RunTest() + { + try + { + var selection = window.getSelection(); + var expectedText = "some textnew text"; + var div1 = document.getElementById("div1"); + var range = document.createRange(); + range.selectNode(div1); + selection.addRange(range); + + var ele = document.createElement("div"); + var tNode = document.createTextNode("new text"); + ele.appendChild(tNode); + div1.appendChild(ele); + + if (expectedText == selection.toString()) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p>This test inserts a new element with a text node child into the current selection.</p> + <div id="div1">some text</div> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm new file mode 100644 index 000000000..869e5391d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm @@ -0,0 +1,73 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Call removeAllRanges() to clear the selection</title> + <script type="text/javascript"> + var testPassed = true; + + function checkDefaultSelectionAttributes() + { + var selection = window.getSelection(); + if (null != selection.anchorNode) + { + testPassed = false; + } + if (0 != selection.anchorOffset) + { + testPassed = false; + } + if (null != selection.focusNode) + { + testPassed = false; + } + if (0 != selection.focusOffset) + { + testPassed = false; + } + if (!selection.isCollapsed) + { + testPassed = false; + } + if (0 != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + selection.removeAllRanges(); + + checkDefaultSelectionAttributes(); + if ("" != selection.toString()) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Call removeAllRanges() to clear the selection</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm new file mode 100644 index 000000000..e35047b47 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm @@ -0,0 +1,72 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Remove the range from the selection</title> + <script type="text/javascript"> + var testPassed = true; + + function checkDefaultSelectionAttributes() + { + var selection = window.getSelection(); + if (null != selection.anchorNode) + { + testPassed = false; + } + if (0 != selection.anchorOffset) + { + testPassed = false; + } + if (null != selection.focusNode) + { + testPassed = false; + } + if (0 != selection.focusOffset) + { + testPassed = false; + } + if (!selection.isCollapsed) + { + testPassed = false; + } + if (0 != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var selection = window.getSelection(); + var p1 = document.getElementById("p1"); + + var range = document.createRange(); + range.selectNode(p1); + selection.addRange(range); + selection.removeRange(range); + + checkDefaultSelectionAttributes(); + if ("" != selection.toString()) + { + testPassed = false; + } + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <p id="p1">Remove the range from the selection by calling removeRange()</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm new file mode 100644 index 000000000..f6a31f249 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm @@ -0,0 +1,72 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Call select() on a text field</title> + <script type="text/javascript"> + var testPassed = true; + + function checkDefaultSelectionAttributes() + { + var selection = window.getSelection(); + if (null != selection.anchorNode) + { + testPassed = false; + } + if (0 != selection.anchorOffset) + { + testPassed = false; + } + if (null != selection.focusNode) + { + testPassed = false; + } + if (0 != selection.focusOffset) + { + testPassed = false; + } + if (!selection.isCollapsed) + { + testPassed = false; + } + if (0 != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var input1 = document.getElementById("input1"); + + input1.select(); + + checkDefaultSelectionAttributes(); + + var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd); + if (input1.value != selectionText) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" /> + <p>Select the text in the input element by calling select()</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm new file mode 100644 index 000000000..a3ab4f57d --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm @@ -0,0 +1,32 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Call selectAllChildren() where the parameter is a text node</title> + <script type="text/javascript"> + function RunTest() + { + try + { + var selection = window.getSelection(); + var div1 = document.getElementById("div1"); + selection.selectAllChildren(div1.firstChild); + + if ("" == selection.toString()) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <div id="div1">Call selectAllChildren() where the parameter is a text node</div> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm new file mode 100644 index 000000000..c5b69d570 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm @@ -0,0 +1,74 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Set selectionStart and selectionEnd on a text field</title> + <script type="text/javascript"> + var testPassed = true; + + function checkDefaultSelectionAttributes() + { + var selection = window.getSelection(); + if (null != selection.anchorNode) + { + testPassed = false; + } + if (0 != selection.anchorOffset) + { + testPassed = false; + } + if (null != selection.focusNode) + { + testPassed = false; + } + if (0 != selection.focusOffset) + { + testPassed = false; + } + if (!selection.isCollapsed) + { + testPassed = false; + } + if (0 != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var input1 = document.getElementById("input1"); + var expectedResult = "text"; + + input1.selectionStart = 5; + input1.selectionEnd = 9; + + checkDefaultSelectionAttributes(); + + var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd); + if (expectedResult != selectionText) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" /> + <p>Select some text in the input element by setting selectionStart and selectionEnd</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm new file mode 100644 index 000000000..a6d7a0f2b --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm @@ -0,0 +1,73 @@ +<!DOCTYPE HTML> +<html> + <head> + <title id="desc">HTML5 Selection: Call setSelectionRange() on a text field</title> + <script type="text/javascript"> + var testPassed = true; + + function checkDefaultSelectionAttributes() + { + var selection = window.getSelection(); + if (null != selection.anchorNode) + { + testPassed = false; + } + if (0 != selection.anchorOffset) + { + testPassed = false; + } + if (null != selection.focusNode) + { + testPassed = false; + } + if (0 != selection.focusOffset) + { + testPassed = false; + } + if (!selection.isCollapsed) + { + testPassed = false; + } + if (0 != selection.rangeCount) + { + testPassed = false; + } + } + + function RunTest() + { + try + { + var input1 = document.getElementById("input1"); + var expectedResult = "input"; + + input1.setSelectionRange(16, 21); + + checkDefaultSelectionAttributes(); + + var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd); + if (expectedResult != selectionText) + { + testPassed = false; + } + + if (testPassed) + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + } + catch (ex) + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + } + </script> + </head> + <body onload="RunTest();"> + <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" /> + <p>Call setSelectionRange() on the input element to select some of the text</p> + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id="testresult">FAIL</div> + </body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/echo.js b/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/echo.js new file mode 100644 index 000000000..02184921c --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/echo.js @@ -0,0 +1 @@ +onmessage = function (ev) { postMessage(ev.data); }
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/structuredclone_0.html b/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/structuredclone_0.html new file mode 100644 index 000000000..ed0e35d9a --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/structuredclone/structuredclone_0.html @@ -0,0 +1,400 @@ +<!doctype html> +<html> + <head> + <meta content="text/html; charset=utf-8" http-equiv="content-type" /> + <title>2.8 Common DOM interfaces - Structured Clone Algorithm </title> + <link rel="help" href="http://www.w3.org/TR/html5/common-dom-interfaces.html#safe-passing-of-structured-data" /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <div id="log"></div> + +<script type="text/javascript"> + var worker; + var testCollection; + setup(function() + { + //the worker is used for each test in sequence + //worker's callback will be set for each test + //worker's internal onmessage echoes the data back to this thread through postMessage + worker = new Worker("./echo.js"); + testCollection = [ + function() { + var t = async_test("Primitive string is cloned"); + t.id = 0; + worker.onmessage = t.step_func(function(e) {assert_equals("primitive string", e.data, "\"primitive string\" === event.data"); t.done(); }); + t.step(function() { worker.postMessage("primitive string");}); + }, + function() { + var t = async_test("Primitive integer is cloned"); + t.id = 1; + worker.onmessage = t.step_func(function(e) {assert_equals(2000, e.data, "2000 === event.data"); t.done(); }); + t.step(function() { worker.postMessage(2000);}); + }, + function() { + var t = async_test("Primitive floating point is cloned"); + t.id = 2; + worker.onmessage = t.step_func(function(e) {assert_equals(111.456, e.data, "111.456 === event.data"); t.done(); }); + t.step(function() { worker.postMessage(111.456);}); + }, + function() { + var t = async_test("Primitive floating point (negative) is cloned"); + t.id = 3; + worker.onmessage = t.step_func(function(e) {assert_equals(-111.456, e.data, "-111.456 === event.data"); t.done(); }); + t.step(function() { worker.postMessage(-111.456);}); + }, + function() { + var t = async_test("Primitive number (hex) is cloned"); + t.id = 4; + worker.onmessage = t.step_func(function(e) {assert_equals(0xAB25, e.data, "0xAB25 === event.data"); t.done(); }); + t.step(function() { worker.postMessage(0xAB25);}); + }, + function() { + var t = async_test("Primitive number (scientific) is cloned"); + t.id = 5; + worker.onmessage = t.step_func(function(e) {assert_equals(15e2, e.data, "15e2 === event.data"); t.done(); }); + t.step(function() { worker.postMessage(15e2);}); + }, + function() { + var t = async_test("Primitive boolean is cloned"); + t.id = 6; + worker.onmessage = t.step_func(function(e) {assert_equals(false, e.data, "false === event.data"); t.done(); }); + t.step(function() { worker.postMessage(false);}); + }, + function() { + var t = async_test("Instance of Boolean is cloned"); + t.id = 7; + var obj; + t.step(function() {obj = new Boolean(false);}); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "Boolean === event.data.constructor"); + assert_equals(obj.valueOf(), e.data.valueOf(), "(new Boolean(false)).valueof() === event.data.valueOf()"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + },function() { + var t = async_test("Instance of Number is cloned"); + t.id = 8; + var obj; + t.step(function() {obj = new Number(2000);}); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "Number === event.data.constructor"); + assert_equals(obj.valueOf(), e.data.valueOf(), "(new Number(2000)).valueof() === event.data.valueOf()"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Instance of String is cloned"); + t.id = 9; + var obj; + t.step(function() { obj = new String("String Object");}); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "String === event.data.constructor"); + assert_equals(obj.valueOf(), e.data.valueOf(), "(new String(\"String Object\")).valueof() === event.data.valueOf()"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Instance of Date is cloned"); + t.id = 10; + var obj; + t.step(function() { obj= new Date(2011,1,1);}); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "Date === event.data.constructor"); + assert_equals(obj.valueOf(), e.data.valueOf(), "(new Date(2011,1,1)).valueof() === event.data.valueOf()"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Instance of RegExp is cloned"); + t.id = 11; + var obj; + t.step(function() {obj = new RegExp("w3+c","g","i");}); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "RegExp === event.data.constructor"); + assert_equals(obj.source, e.data.source, "canon.source === event.data.source"); + assert_equals(obj.multiline, e.data.multiline, "canon.multiline === event.data.multiline"); + assert_equals(obj.global, e.data.global, "canon.global === event.data.global"); + assert_equals(obj.ignoreCase, e.data.ignoreCase, "canon.ignoreCase === event.data.ignoreCase"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Value 'null' is cloned"); + t.id = 12; + worker.onmessage = t.step_func(function(e) {assert_equals(null, e.data, "null === event.data"); t.done(); }); + t.step(function() { worker.postMessage(null);}); + }, + function() { + var t = async_test("Value 'undefined' is cloned"); + t.id = 13; + worker.onmessage = t.step_func(function(e) {assert_equals(undefined, e.data, "undefined === event.data"); t.done(); }); + t.step(function() { worker.postMessage(undefined);}); + }, + function() { + var t = async_test("Object properties are cloned"); + t.id = 14; + var obj; + t.step(function() { + obj= {}; + obj.a = "test"; + obj.b = 2; + obj["child"] = 3; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(obj.a, e.data.a, "canon.a === event.data.a"); + assert_equals(obj.b, e.data.b, "canon.b === event.data.b"); + assert_equals(obj.child, e.data.child, "canon.child === e.data.child"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Prototype chains are not walked."); + t.id = 15; + function Custom() { + this.a = "hello"; + } + + var obj; + t.step(function() { + Object.defineProperty(Custom.prototype, "b", { enumerable: true, value: 100 }); + obj = new Custom(); + }); + worker.onmessage = t.step_func(function(e) { + assert_not_equals(obj.constructor, e.data.constructor, "canon.constructor !== event.data.constructor"); + assert_equals(Object, e.data.constructor, "Object === e.data.constructor"); + assert_equals(obj.a, e.data.a, "canon.a === e.data.a"); + assert_equals(undefined, e.data.b, "undefined === e.data.b"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Property descriptors of Objects are not cloned"); + t.id = 16; + var obj; + t.step(function() { + obj = {}; + Object.defineProperty(obj, "a", { enumerable: true, writable: false, value: 100 }); + }); + worker.onmessage = t.step_func(function(e) { + var des = Object.getOwnPropertyDescriptor(e.data, "a"); + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_true(des.writable, "Descriptor is writable"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Cycles are preserved in Objects"); + t.id = 17; + var obj; + t.step(function() { + obj = {}; + obj.a = obj; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(e.data, e.data.a, "cycle is preserved"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Identity of duplicates is preserved"); + t.id = 18; + var ref; + var obj; + t.step(function() { + ref = {}; + ref.called = 0; + Object.defineProperty(ref, "child", {get: function(){this.called++;}, enumerable: true}); + + obj = {a:ref, b:ref}; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(e.data.b.called, 0, "e.data.b.called === 0"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Property order is preserved"); + t.id = 19; + var obj; + t.step(function() { + obj = { "a": "hello", "b": "w3c", "c": "and world" }; + obj["a"] = "named1"; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + var canonNames = Object.getOwnPropertyNames(obj); + var testNames = Object.getOwnPropertyNames(e.data); + for (var i in canonNames) { + assert_equals(canonNames[i], testNames[i], "canonProperty["+i+"] === dataProperty["+i+"]"); + } + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Enumerable properties of Arrays are cloned"); + t.id = 20; + var obj; + t.step(function() { + obj = [0,1]; + obj["a"] = "named1"; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(e.data["a"], "named1", "e.data[\"a\"] === \"named1\""); + assert_equals(e.data[0], 0, "e.data[0] === 0"); + assert_equals(e.data[1], 1, "e.data[1] === 1"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Property descriptors of Arrays are not cloned"); + t.id = 21; + var obj; + t.step(function() { + obj = [0, 1]; + Object.defineProperty(obj, "2", { enumerable: true, writable: false, value: 100 }); + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(e.data[0], 0, "e.data[0] === 0"); + assert_equals(e.data[1], 1, "e.data[1] === 1"); + var des = Object.getOwnPropertyDescriptor(e.data, "2"); + assert_true(des.writable, "Descriptor is writable"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Cycles are preserved in Arrays"); + t.id = 22; + var obj; + t.step(function() { + obj = [0,1]; + obj[2] = obj; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_equals(e.data[0], 0, "e.data[0] === 0"); + assert_equals(e.data[1], 1, "e.data[1] === 1"); + assert_equals(e.data[2], e.data, "e.data[2] === e.data"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + + function() { + var t = async_test("ImageData object can be cloned"); + t.id = 23; + var obj; + t.step(function() { + var canvas = document.createElement("canvas"); + canvas.width = 40; + canvas.height = 40; + var context = canvas.getContext('2d'); + obj = context.createImageData(40, 40); + assert_true(window.hasOwnProperty("ImageData"), "ImageData constructor must be present"); + assert_true(obj instanceof ImageData, "ImageData must be returned by .createImageData"); + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_not_equals(obj, e.data, "cloned object should be a new instance of ImageData"); + assert_equals(obj.width, e.data.width, "canon.width === e.data.width"); + assert_equals(obj.height, e.data.height, "canon.height === e.data.height"); + assert_array_equals(obj.data, e.data.data, "data arrays are the same"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("ImageData expandos are not cloned"); + t.id = 24; + var obj; + t.step(function() { + var canvas = document.createElement("canvas"); + canvas.width = 40; + canvas.height = 40; + var context = canvas.getContext('2d'); + obj = context.createImageData(40, 40); + assert_true(window.hasOwnProperty("ImageData"), "ImageData constructor must be present"); + assert_true(obj instanceof ImageData, "ImageData must be returned by .createImageData"); + obj.foo = "bar"; + }); + worker.onmessage = t.step_func(function(e) { + assert_equals(obj.constructor, e.data.constructor, "canon.constructor === event.data.constructor"); + assert_not_equals(obj, e.data, "cloned object should be a new instance of ImageData"); + assert_equals(obj.width, e.data.width, "canon.width === e.data.width"); + assert_equals(obj.height, e.data.height, "canon.height === e.data.height"); + assert_array_equals(obj.data, e.data.data, "data arrays are the same"); + assert_equals(undefined, e.data.foo, "Expando is lost (undefined === e.data.foo)"); + t.done(); + }); + t.step(function() { worker.postMessage(obj);}); + }, + function() { + var t = async_test("Window objects cannot be cloned"); + t.id = 25; + worker.onmessage = function() {}; //no op because exception should be thrown. + t.step(function() { + assert_true(DOMException.hasOwnProperty('DATA_CLONE_ERR'), "DOMException.DATA_CLONE_ERR is present"); + assert_equals(DOMException.DATA_CLONE_ERR, 25, "DOMException.DATA_CLONE_ERR === 25"); + assert_throws('DATA_CLONE_ERR', function() {worker.postMessage(window)}); + }); + t.done(); + }, + function() { + var t = async_test("Document objects cannot be cloned"); + t.id = 26; + worker.onmessage = function() {}; //no op because exception should be thrown. + t.step(function() { + assert_true(DOMException.hasOwnProperty('DATA_CLONE_ERR'), "DOMException.DATA_CLONE_ERR is present"); + assert_equals(DOMException.DATA_CLONE_ERR, 25, "DOMException.DATA_CLONE_ERR === 25"); + assert_throws('DATA_CLONE_ERR', function() {worker.postMessage(document)}); + }); + t.done(); + } + ]; + }, {explicit_done:true}); + + //Callback for result_callback + //queues the next test in the array testCollection + //serves to make test execution sequential from the async worker callbacks + //alternatively, we would have to create a worker for each test + function testFinished(test) { + if(test.id < testCollection.length - 1) { + //queue the function so that stack remains shallow + queue(testCollection[test.id+1]); + } else { + //when the last test has run, explicitly end test suite + done(); + } + } + function queue(func) { + setTimeout(func, 10); + } + + add_result_callback(testFinished); + //start the first test manually + queue(testCollection[0]); + + + + + </script> +</body> +</html> diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_bottom.xhtml b/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_bottom.xhtml Binary files differnew file mode 100644 index 000000000..84da6dbf6 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_bottom.xhtml diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_top.xhtml b/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_top.xhtml Binary files differnew file mode 100644 index 000000000..83b8c62e5 --- /dev/null +++ b/testing/web-platform/tests/old-tests/submission/Microsoft/xhtml5/colgroup_valign_top.xhtml |