diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /LayoutTests/fast | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'LayoutTests/fast')
16 files changed, 238 insertions, 10 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt new file mode 100644 index 0000000..c7f2d2b --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt @@ -0,0 +1,10 @@ +Tests that when a page is reloaded, the frame is properly detached from the Geolocation object to ensure that no permission requests are in progress. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS numPendingRequests is 0 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html new file mode 100644 index 0000000..5b6aa5c --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/page-reload-cancel-permission-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html b/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html new file mode 100644 index 0000000..4a4a715 --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> + <head> + </head> + <body onload="window.parent.onIframeReady()"> + </body> +</html> diff --git a/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html index cfeabae..5370b4c 100644 --- a/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html +++ b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html @@ -11,9 +11,7 @@ function loadNext() { layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); } - navigator.geolocation.watchPosition( - function(p) { window.opener.gotPosition(); }, - function(e) { window.opener.failedToCreateWatch(e); }); + navigator.geolocation.watchPosition(window.opener.gotPosition); } </script> <body onload="loadNext()"></body> diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js new file mode 100644 index 0000000..7ac291b --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js @@ -0,0 +1,44 @@ +description("Tests that when a page is reloaded, the frame is properly detached from the Geolocation object " + + "to ensure that no permission requests are in progress."); + +window.jsTestIsAsync = true; + +var numPendingRequests; +var isReload = false; + +if ("#reload" == location.hash) + isReload = true; + +if (window.layoutTestController) { + numPendingRequests = layoutTestController.numberOfPendingGeolocationPermissionRequests(); + shouldBe('numPendingRequests', '0'); + + if (isReload) + finishJSTest(); +} + +if (!isReload) { + // Kick off a position request and then reload the page, this should set up + // a permission request. Permission should be undecided at this point, so the + // permission request should still be outstanding by page reload. + + function onIframeReady() + { + // Make request on remote frame's Geolocation object. + iframe.contentWindow.navigator.geolocation.getCurrentPosition( + function(p) { + testFailed('Permission should not be determined for this page: ' + p); + finishJSTest(); + }); + + location.hash = '#reload'; + location.reload(); + } + + debug("Create IFrame"); + var iframe = document.createElement('iframe'); + iframe.src = 'resources/page-reload-cancel-permission-requests-inner.html'; + document.body.appendChild(iframe); +} + +window.successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js index b27df61..a8f2bda 100644 --- a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js +++ b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js @@ -28,12 +28,6 @@ function waitForWindowToClose() finishJSTest(); } -function failedToCreateWatch(e) -{ - testFailed("Failed to create watch: " + e); - finishJSTest(); -} - debug("Main page opening resources/window-close-popup.html"); otherWindow = window.open("resources/window-close-popup.html"); diff --git a/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt new file mode 100644 index 0000000..a2dc689 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt @@ -0,0 +1,5 @@ +PASS str is 'threw exception' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html new file mode 100644 index 0000000..309ab10 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<head> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<div id="test"> + <div id="console"></div> +</body> +<script> +window.jsTestIsAsync = true; + +var form, input, str; + +window.onload = function() +{ + form = document.body.appendChild(document.createElement("form")); + form.id = "form"; + + input = document.createElement("input"); + input.id = "input"; + input.setAttribute("form", "form"); + form.elements.namedItem("input"); + + input = null; + + gc(); + setTimeout(step2, 100); +} + +function step2() +{ + try { + str = typeof form['input'].form; + } catch(e) { + str = 'threw exception'; + } + shouldBe("str", "'threw exception'"); + finishJSTest(); +} + +window.successfullyParsed = true; +</script> +<script src="../../js/resources/js-test-post.js"></script> +</html> diff --git a/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt new file mode 100644 index 0000000..da58066 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt @@ -0,0 +1,5 @@ +PASS typeof select.options.namedItem('option') is 'undefined' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html new file mode 100644 index 0000000..bf8ffd1 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<head> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<div id="test"> + <div id="console"></div> +</body> +<script> +window.jsTestIsAsync = true; + +var select, doc1, doc2, str; + +window.onload = function() +{ + select = document.createElement("select"); + var option = select.appendChild(document.createElement("option")); + option.id = "option"; + + doc1 = document.implementation.createHTMLDocument(); + doc2 = document.implementation.createHTMLDocument(); + + doc1.body.appendChild(select); + select.options.namedItem("option"); + + select.removeChild(option); + option = null; + + gc(); + setTimeout(step2, 100); +} + +function step2() +{ + doc1.body.removeChild(select); + doc2.body.appendChild(select); + shouldBe("typeof select.options.namedItem('option')", "'undefined'"); + finishJSTest(); +} + +window.successfullyParsed = true; +</script> +<script src="../../js/resources/js-test-post.js"></script> +</html> diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt new file mode 100644 index 0000000..c7fb018 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt @@ -0,0 +1,2 @@ +PASS beforeload called +This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below. diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html new file mode 100644 index 0000000..27a62af --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html @@ -0,0 +1,14 @@ +<body> +<div id="console"></div> +<script src="../../js/resources/js-test-pre.js"></script> +<script> +if (window.layoutTestController) { + layoutTestController.dumpAsText(); +} +</script> +<html> +<p>This test will only print "PASS" or "FAIL" if link prefetches are +enabled, otherwise it will show nothing below.</p> +<link href="prefetch.link" rel="prefetch" onbeforeload="testPassed('beforeload called');return false" onload="testFailed('onload')" onerror="testFailed('onerror')" /> +</html> + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt new file mode 100644 index 0000000..47fc987 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt @@ -0,0 +1,6 @@ +This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect. + +If it works you should see a message below saying the test has passed. + +PASS onerror was called + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html new file mode 100644 index 0000000..07ced9e --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html @@ -0,0 +1,25 @@ +<html> +<head> +<script src="../../js/resources/js-test-pre.js"></script> +<script type="text/javascript"> +function done() +{ + testPassed('onerror was called'); + if (window.layoutTestController) + layoutTestController.notifyDone(); +} +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} +</script> +</head> +<body> +<p>This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect.</p> +<p>If it works you should see a message below saying the test has passed.</p> +<link href="prefetch-noexisty.link" rel="prefetch" onload="testFailed('onload event should not occur')" onerror="done()"> +<hr> +<div id="console"></div> +</body> +</html> + diff --git a/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt b/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt index 4aea68a..15ca8a8 100644 --- a/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt +++ b/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt @@ -2,4 +2,3 @@ This XML file does not appear to have any style information associated with it. <TEST> Should be "CYRILLIC SMALL LETTER IO" (like e with diaeresis): ё </TEST> - diff --git a/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js b/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js new file mode 100644 index 0000000..df8cb08 --- /dev/null +++ b/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js @@ -0,0 +1,16 @@ +description("Test to ensure that js constructors create objects with the correct constructor"); + +var otherGlobal = document.getElementsByTagName("iframe")[0].contentWindow; +var constructors = ["Object", "Function", "Array", "Number", "String", "Boolean", "RegExp", "Date", "Error", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Image"]; + +for (var i = 0; i < constructors.length; i++) { + shouldBeTrue("new otherGlobal." + constructors[i] + "() instanceof otherGlobal." + constructors[i]); + try { + if ((typeof (otherGlobal[constructors[i]]())) === "object" || (typeof (otherGlobal[constructors[i]]())) === "function") + shouldBeTrue("otherGlobal." + constructors[i] + "() instanceof otherGlobal." + constructors[i]); + } catch(e) { + + } +} + +successfullyParsed = true; |