diff options
Diffstat (limited to 'webkit/data')
3 files changed, 62 insertions, 0 deletions
diff --git a/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html b/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html new file mode 100644 index 0000000..fe82461 --- /dev/null +++ b/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html @@ -0,0 +1,28 @@ +<html>
+<body onload="RunTest()">
+<script>
+// Used from the top frame to know when this frame has been loaded.
+var loaded = false;
+
+// After the top frame has accessed the document of this frame, we
+// test that the document wrapper was created in this context and
+// not in the top context.
+function RunTest() {
+ loaded = true;
+ if (top.innerDocument) {
+ var paragraph = document.createElement('p');
+ if (HTMLElement.prototype.isPrototypeOf(paragraph)) {
+ top.WriteOutput("PASS");
+ } else {
+ top.WriteOutput("FAIL");
+ }
+ if (window.layoutTestController) {
+ layoutTestController.notifyDone();
+ }
+ } else {
+ setTimeout(RunTest, 100);
+ }
+}
+</script>
+</body>
+</html>
diff --git a/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt new file mode 100644 index 0000000..0cdd613 --- /dev/null +++ b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt @@ -0,0 +1 @@ +PASS
diff --git a/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html new file mode 100644 index 0000000..e81c40a --- /dev/null +++ b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html @@ -0,0 +1,33 @@ +<html>
+<body onload="AccessInnerDocument()">
+<div id="output"></div>
+<iframe id="inner" src="resources/wrapper-context-inner.html"></iframe>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+}
+
+// Write to the output div.
+function WriteOutput(s) {
+ var paragraph = document.createElement("p");
+ paragraph.innerHTML = s;
+ document.getElementById("output").appendChild(paragraph);
+}
+
+// Used from the inner frame to know when this frame has accessed
+// the document of the inner frame.
+var innerDocument;
+
+// Once the inner frame has loaded, access it's document and assign
+// the wrapper to innerDocument.
+function AccessInnerDocument() {
+ if (inner.loaded) {
+ innerDocument = inner.document;
+ } else {
+ setTimeout(AccessInnerDocument, 100);
+ }
+}
+</script>
+</body>
+</html>
|