[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Tue Jan 5 23:57:57 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit b4014436077e5de3d5ad01b118e65af4ce0be3d1
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 21 23:50:00 2009 +0000
2009-12-21 Dirk Pranke <dpranke at chromium.org>
Reviewed by Adam Barth.
Upstream a bunch of platform-specific Chromium plugin tests.
https://bugs.webkit.org/show_bug.cgi?id=32751
* platform/chromium/plugins/call-as-function-expected.txt: Added.
* platform/chromium/plugins/call-as-function.html: Added.
* platform/chromium/plugins/get-url-with-iframe-target-no-crash-expected.txt: Added.
* platform/chromium/plugins/get-url-with-iframe-target-no-crash.html: Added.
* platform/chromium/plugins/multiple-plugins-expected.txt: Added.
* platform/chromium/plugins/multiple-plugins.html: Added.
* platform/chromium/plugins/nested-plugin-objects-expected.txt: Added.
* platform/chromium/plugins/nested-plugin-objects.html: Added.
* platform/chromium/plugins/refcount-leaks-expected.txt: Added.
* platform/chromium/plugins/refcount-leaks.html: Added.
* platform/chromium/plugins/return-npobject-expected.txt: Added.
* platform/chromium/plugins/return-npobject.html: Added.
* platform/chromium/plugins/script-object-invoke-expected.txt: Added.
* platform/chromium/plugins/script-object-invoke.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cea1f6a..f7c2aa4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,27 @@
2009-12-21 Dirk Pranke <dpranke at chromium.org>
+ Reviewed by Adam Barth.
+
+ Upstream a bunch of platform-specific Chromium plugin tests.
+ https://bugs.webkit.org/show_bug.cgi?id=32751
+
+ * platform/chromium/plugins/call-as-function-expected.txt: Added.
+ * platform/chromium/plugins/call-as-function.html: Added.
+ * platform/chromium/plugins/get-url-with-iframe-target-no-crash-expected.txt: Added.
+ * platform/chromium/plugins/get-url-with-iframe-target-no-crash.html: Added.
+ * platform/chromium/plugins/multiple-plugins-expected.txt: Added.
+ * platform/chromium/plugins/multiple-plugins.html: Added.
+ * platform/chromium/plugins/nested-plugin-objects-expected.txt: Added.
+ * platform/chromium/plugins/nested-plugin-objects.html: Added.
+ * platform/chromium/plugins/refcount-leaks-expected.txt: Added.
+ * platform/chromium/plugins/refcount-leaks.html: Added.
+ * platform/chromium/plugins/return-npobject-expected.txt: Added.
+ * platform/chromium/plugins/return-npobject.html: Added.
+ * platform/chromium/plugins/script-object-invoke-expected.txt: Added.
+ * platform/chromium/plugins/script-object-invoke.html: Added.
+
+2009-12-21 Dirk Pranke <dpranke at chromium.org>
+
Reviewed by Darin Adler.
Upstream a test to ensure we handle variations on "javascript:" URL
diff --git a/LayoutTests/platform/chromium/plugins/call-as-function-expected.txt b/LayoutTests/platform/chromium/plugins/call-as-function-expected.txt
new file mode 100644
index 0000000..862f350
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/call-as-function-expected.txt
@@ -0,0 +1,4 @@
+This tests that call a plugin object (NPObject) as a function invokes invokeDefault() function on the object.
+
+plg() = 1
+plg.testObject() = 2
diff --git a/LayoutTests/platform/chromium/plugins/call-as-function.html b/LayoutTests/platform/chromium/plugins/call-as-function.html
new file mode 100644
index 0000000..7ed61ee
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/call-as-function.html
@@ -0,0 +1,25 @@
+<html>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function runTest() {
+ var c = document.getElementById('console');
+ var p = document.getElementById('plg');
+ var x = p();
+ c.innerHTML += 'plg() = ' + x + '<br>';
+
+ var y = p.testObject();
+ c.innerHTML += 'plg.testObject() = ' + y + '<br>';
+}
+</script>
+<body onload='runTest()'>
+<embed id="plg" type="application/x-webkit-test-netscape"></embed><P>
+
+This tests that call a plugin object (NPObject) as a function invokes
+invokeDefault() function on the object.
+
+<div id="console"></div>
+</body>
+</html>
+
diff --git a/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash-expected.txt b/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash-expected.txt
new file mode 100644
index 0000000..64edcc7
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash-expected.txt
@@ -0,0 +1,3 @@
+This tests that we do not crash upon trying to deliver NPP_URLNotify to a plugin that has been deleted.
+SUCCESS
+
diff --git a/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash.html b/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash.html
new file mode 100644
index 0000000..35d1a09
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/get-url-with-iframe-target-no-crash.html
@@ -0,0 +1,21 @@
+<html>
+<script>
+function runtest() {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ plg.getURLNotify("data:text/html,<body onload='layoutTestController.notifyDone()'></body>", "frame", "callback");
+ plg.parentNode.removeChild(plg)
+ } else {
+ document.write("Cannot run interactively");
+ }
+}
+</script>
+<body onload="runtest()">
+<embed id="plg" type="application/x-webkit-test-netscape"></embed>
+This tests that we do not crash upon trying to deliver NPP_URLNotify to
+a plugin that has been deleted.
+<div id="result">SUCCESS</div>
+<iframe id="frame"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/plugins/multiple-plugins-expected.txt b/LayoutTests/platform/chromium/plugins/multiple-plugins-expected.txt
new file mode 100644
index 0000000..18445a5
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/multiple-plugins-expected.txt
@@ -0,0 +1,5 @@
+Test that we can create two plugins, and independently clean each. Prints "SUCCESS" on success, "FAILURE" on failure.
+Got testObj1 property
+Got testObj2 property
+Got testObj2 property
+SUCCESS
diff --git a/LayoutTests/platform/chromium/plugins/multiple-plugins.html b/LayoutTests/platform/chromium/plugins/multiple-plugins.html
new file mode 100644
index 0000000..503994a
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/multiple-plugins.html
@@ -0,0 +1,90 @@
+<script>
+ function noop(x) {
+ }
+
+ function doGC() {
+ if (window.gc) {
+ // GC twice to make sure everything is cleaned up.
+ for (var i = 0; i < 4; i++) {
+ window.gc();
+ }
+ }
+ }
+
+ function runtest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ doGC();
+
+ var plug1 = document.getElementById("plug1");
+ var plug2 = document.getElementById("plug2");
+ var output = document.getElementById("output");
+ output.innerHTML = "";
+
+ var testObj1 = plug1.testObject;
+ var testObj2 = plug2.testObject;
+
+ var successCount = 0;
+
+ // Verify we can access each object.
+ if (testObj1.foo == "foo") {
+ successCount++;
+ output.innerHTML += "Got testObj1 property<br>";
+ }
+ if (testObj2.foo == "foo") {
+ successCount++;
+ output.innerHTML += "Got testObj2 property<br>";
+ }
+
+ // Now remove the first plugin
+ plug1.parentNode.removeChild(plug1);
+
+ try {
+ if (testObj1.foo == "foo") {
+ output.innerHTML = "Accessed nuked object!<br>";
+ }
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ try {
+ if (testObj2.foo == "foo") {
+ successCount++;
+ output.innerHTML += "Got testObj2 property<br>";
+ }
+ } catch(e) {
+ output.inerHTML += "Reference error accessing live object: " + e;
+ }
+
+ // Now remove the second plugin
+ plug2.parentNode.removeChild(plug2);
+
+ try {
+ if (testObj2.foo == "foo") {
+ output.innerHTML = "Accessed nuked object!<br>";
+ }
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ var success = (successCount == 5);
+ output.innerHTML += (success ? "SUCCESS" : "FAILURE");
+ }
+</script>
+
+<body onload="runtest()">
+
+Test that we can create two plugins, and independently clean each.
+
+Prints "SUCCESS" on success, "FAILURE" on failure.
+
+<embed id="plug1" type="application/x-webkit-test-netscape">
+<embed id="plug2" type="application/x-webkit-test-netscape">
+
+<div id=output>FAILURE</div>
+
+</body>
+
diff --git a/LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt b/LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt
new file mode 100644
index 0000000..08ba7b5
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/nested-plugin-objects-expected.txt
@@ -0,0 +1,17 @@
+CONSOLE MESSAGE: line 29: PLUGIN: NPP_Destroy
+This tests that objects from plugin objects are properly cleaned up.
+
+Example:
+ plugin
+ ------- (Creates) ------ Object1
+ ------- (Creates) ------ Object2
+
+It is important that both Object1 and Object2 cleanup as a result of
+cleaning up the plugin.
+
+SUCCESS
+
+
+
+
+
diff --git a/LayoutTests/platform/chromium/plugins/nested-plugin-objects.html b/LayoutTests/platform/chromium/plugins/nested-plugin-objects.html
new file mode 100644
index 0000000..1cd995f
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/nested-plugin-objects.html
@@ -0,0 +1,80 @@
+<html>
+<script>
+
+var callbackCount = 0;
+
+function npapiCallback(x) {
+ callbackCount++;
+}
+
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var successCount = 0;
+ var plugin = document.getElementById("testPlugin");
+ plugin.logDestroy = true;
+
+ var testObject = plugin.testObject;
+ plugin.testPassTestObject("npapiCallback", testObject);
+ var testObject2 = testObject.testObject;
+ plugin.testPassTestObject("npapiCallback", testObject2);
+ var testObject3 = testObject2.testObject;
+ plugin.testPassTestObject("npapiCallback", testObject3);
+
+ if (callbackCount == 3)
+ successCount++;
+
+ plugin.parentNode.removeChild(plugin);
+
+ try {
+ testObject.property;
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ try {
+ testObject.property = 'hello';
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ try {
+ testObject2.property;
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ try {
+ testObject3.property;
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ successCount++;
+ }
+
+ if (successCount == 5)
+ document.getElementById('result').innerHTML = 'SUCCESS';
+}
+
+</script>
+
+<body onload="runTest();">
+<pre>
+This tests that objects from plugin objects are properly cleaned up.
+
+Example:
+ plugin
+ ------- (Creates) ------ Object1
+ ------- (Creates) ------ Object2
+
+It is important that both Object1 and Object2 cleanup as a result of
+cleaning up the plugin.
+
+<div id="result">FAILURE</div>
+<embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/plugins/refcount-leaks-expected.txt b/LayoutTests/platform/chromium/plugins/refcount-leaks-expected.txt
new file mode 100644
index 0000000..3f76868
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/refcount-leaks-expected.txt
@@ -0,0 +1,14 @@
+Test that we can get an NPObject returned through a method on an NPAPI Object.
+Prints "SUCCESS" on success, "FAILURE" on failure.
+
+--- num test objects:
+originally: 1
+after creation: 4
+after GC: 1
+
+--- refcount on plug.testObject:
+originally: 2
+after get: 2
+after GC: 2
+after passing: 2
+SUCCESS
diff --git a/LayoutTests/platform/chromium/plugins/refcount-leaks.html b/LayoutTests/platform/chromium/plugins/refcount-leaks.html
new file mode 100644
index 0000000..97665aa
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/refcount-leaks.html
@@ -0,0 +1,81 @@
+<script>
+ function noop(x) {
+ }
+
+ function doGC() {
+ if (window.gc) {
+ // GC twice to make sure everything is cleaned up.
+ for (var i = 0; i < 2; i++) {
+ window.gc();
+ }
+ }
+ }
+
+ function runtest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+
+ var output = document.getElementById("output");
+ output.innerHTML = "";
+
+ // Test that objects are deleted after their JS references are released.
+ var countOrig = plug.testObjectCount;
+ o1 = plug.testCreateTestObject();
+ o2 = plug.testCreateTestObject();
+ o3 = plug.testCreateTestObject();
+ var countAfterCreate = plug.testObjectCount;
+ o1 = o2 = o3 = null;
+ doGC();
+ var countAfterGC = plug.testObjectCount;
+
+ output.innerHTML += "--- num test objects:<br>";
+ output.innerHTML += "originally: " + countOrig + "<br>";
+ output.innerHTML += "after creation: " + countAfterCreate + "<br>";
+ output.innerHTML += "after GC: " + countAfterGC + "<br>";
+ output.innerHTML += "<br>";
+
+ // Test that the object refcount returns to normal after JS references
+ // are released.
+ var testObj = plug.testObject;
+ var refOrig = testObj.refCount;
+ var o1 = plug.testObject;
+ var o2 = plug.testObject;
+ var o3 = plug.testObject;
+ var refAfterGet = testObj.refCount;
+ o1 = o2 = o3 = null;
+ doGC();
+ var refAfterGetGC = testObj.refCount;
+
+ // Test that calling NPN_Invoke with our object as a parameter returns
+ // our refcount to normal (may require a GC).
+ plug.testPassTestObject("noop", testObj);
+ plug.testPassTestObject("noop", testObj);
+ plug.testPassTestObject("noop", testObj);
+ doGC();
+ var refAfterPass = testObj.refCount;
+
+ output.innerHTML += "--- refcount on plug.testObject:<br>";
+ output.innerHTML += "originally: " + refOrig + "<br>";
+ output.innerHTML += "after get: " + refAfterGet + "<br>";
+ output.innerHTML += "after GC: " + refAfterGetGC + "<br>";
+ output.innerHTML += "after passing: " + refAfterPass + "<br>";
+
+ var success = (countAfterGC == countOrig) && (refAfterPass == refOrig);
+ output.innerHTML += (success ? "SUCCESS" : "FAILURE");
+ }
+</script>
+
+<body onload="runtest()">
+
+Test that we can get an NPObject returned through a method on
+an NPAPI Object.<P>
+
+Prints "SUCCESS" on success, "FAILURE" on failure.
+
+<embed name="plug" type="application/x-webkit-test-netscape">
+
+<div id=output>FAILURE</div>
+
+</body>
+
diff --git a/LayoutTests/platform/chromium/plugins/return-npobject-expected.txt b/LayoutTests/platform/chromium/plugins/return-npobject-expected.txt
new file mode 100644
index 0000000..145ed7f
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/return-npobject-expected.txt
@@ -0,0 +1,4 @@
+Test that we can get an NPObject returned through a method on an NPAPI Object. Prints "SUCCESS" on success, "FAILURE" on failure.
+
+
+SUCCESS
diff --git a/LayoutTests/platform/chromium/plugins/return-npobject.html b/LayoutTests/platform/chromium/plugins/return-npobject.html
new file mode 100644
index 0000000..43271b0
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/return-npobject.html
@@ -0,0 +1,32 @@
+
+<script>
+ var test_object = new Object();
+ test_object.value = 1;
+
+ function callbk(arg) {
+ return test_object;
+ }
+
+ function runtest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var obj = plug.testCallbackRet("callbk");
+ if (obj == test_object) {
+ var output = document.getElementById("output");
+ output.innerHTML = "SUCCESS";
+ }
+ }
+</script>
+
+<BODY id="bodyId" onload="runtest()">
+
+<p>Test that we can get an NPObject returned through a method on
+an NPAPI Object. Prints "SUCCESS" on success, "FAILURE" on failure.</p>
+
+<embed name="plug" type="application/x-webkit-test-netscape">
+
+<div id=output>FAILURE</div>
+
+</BODY>
+
diff --git a/LayoutTests/platform/chromium/plugins/script-object-invoke-expected.txt b/LayoutTests/platform/chromium/plugins/script-object-invoke-expected.txt
new file mode 100644
index 0000000..2ecbc63
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/script-object-invoke-expected.txt
@@ -0,0 +1,9 @@
+Test proper tracking of script NPObjects
+
+Test 1: Ensure that script NPObjects are properly tracked (i.e. added to
+ the live objects map in V8).
+
+Test 2: Test tracking of derived NPObjects by invoking a method on a
+ script object and passing it an internally created NPObject.
+
+SUCCESS
diff --git a/LayoutTests/platform/chromium/plugins/script-object-invoke.html b/LayoutTests/platform/chromium/plugins/script-object-invoke.html
new file mode 100644
index 0000000..50fd263
--- /dev/null
+++ b/LayoutTests/platform/chromium/plugins/script-object-invoke.html
@@ -0,0 +1,60 @@
+<html>
+<script>
+// A simple script object with a member function that takes
+// an NPObject as an argument
+FactoryFunction = function() {
+ var TestObject = function() {
+ };
+
+ TestObject.prototype.createObject = function(plugin) {
+ var new_object = plugin.testCloneObject();
+ return new_object;
+ };
+
+ var s = new TestObject();
+ return s;
+};
+
+function new_script_object() {
+ return FactoryFunction();
+}
+
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var plugin = document.getElementById("testPlugin");
+ var returned_object = plugin.testScriptObjectInvoke("new_script_object", "createObject", plugin);
+
+ /* Bug# 1175346 - This will crash in single process mode (or test shell)
+ TODO(joshia): Enable this and fix the NPObject cleanup so that
+ it works in single process mode.
+ plugin.parentNode.removeChild(plugin);
+
+ try {
+ returned_object.property;
+ } catch (e) {
+ if (e instanceof ReferenceError)
+ document.getElementById("result").innerHTML = "SUCCESS";
+ }
+ */
+
+ document.getElementById("result").innerHTML = "SUCCESS";
+}
+</script>
+
+<body onload="runTest();">
+<pre>
+Test proper tracking of script NPObjects
+
+Test 1: Ensure that script NPObjects are properly tracked (i.e. added to
+ the live objects map in V8).
+
+Test 2: Test tracking of derived NPObjects by invoking a method on a
+ script object and passing it an internally created NPObject.
+
+<div id="result">FAILURE</div>
+<embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed>
+</body>
+</html>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list