[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tony at chromium.org tony at chromium.org
Wed Dec 22 15:38:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6161c1b7538a3f38c60739fff511719ff59c305c
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 9 22:48:13 2010 +0000

    2010-11-09  Tony Chang  <tony at chromium.org>
    
            Reviewed by Adam Barth.
    
            run platform/chromium/plugins/return-npobject.html on all platforms
            https://bugs.webkit.org/show_bug.cgi?id=49103
    
            * plugins/return-npobject-expected.txt: Renamed from LayoutTests/platform/chromium/plugins/return-npobject-expected.txt.
            * plugins/return-npobject.html: Renamed from LayoutTests/platform/chromium/plugins/return-npobject.html.
    2010-11-08  Tony Chang  <tony at chromium.org>
    
            Reviewed by Adam Barth.
    
            run platform/chromium/plugins/return-npobject.html on all platforms
            https://bugs.webkit.org/show_bug.cgi?id=49103
    
            This tests that we can get an NPObject returned through a method on
            an NPAPI Object.
    
            * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
            (testCallbackReturn):
            (pluginInvoke):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f28b1db..74f496c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-09  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        run platform/chromium/plugins/return-npobject.html on all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=49103
+
+        * plugins/return-npobject-expected.txt: Renamed from LayoutTests/platform/chromium/plugins/return-npobject-expected.txt.
+        * plugins/return-npobject.html: Renamed from LayoutTests/platform/chromium/plugins/return-npobject.html.
+
 2010-11-09  Ryosuke Niwa  <rniwa at webkit.org>
 
         Unreviewed rebaselines for Chromium.
diff --git a/LayoutTests/platform/chromium/plugins/return-npobject.html b/LayoutTests/platform/chromium/plugins/return-npobject.html
deleted file mode 100644
index 43271b0..0000000
--- a/LayoutTests/platform/chromium/plugins/return-npobject.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-<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/return-npobject-expected.txt b/LayoutTests/plugins/return-npobject-expected.txt
similarity index 100%
rename from LayoutTests/platform/chromium/plugins/return-npobject-expected.txt
rename to LayoutTests/plugins/return-npobject-expected.txt
diff --git a/LayoutTests/plugins/return-npobject.html b/LayoutTests/plugins/return-npobject.html
new file mode 100644
index 0000000..2a64575
--- /dev/null
+++ b/LayoutTests/plugins/return-npobject.html
@@ -0,0 +1,32 @@
+
+<script>
+  var test_object = new Object();
+  test_object.value = 1;
+
+  function callback(arg) {
+    return test_object;
+  }
+
+  function runtest() {
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var obj = plug.testCallbackReturn("callback");
+    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/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 7d3867e..064ea0b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-08  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        run platform/chromium/plugins/return-npobject.html on all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=49103
+
+        This tests that we can get an NPObject returned through a method on
+        an NPAPI Object.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+        (testCallbackReturn):
+        (pluginInvoke):
+
 2010-11-09  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r71672.
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index 7f1c4b4..fdcf66c 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -162,6 +162,7 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
 
 enum {
     ID_TEST_CALLBACK_METHOD = 0,
+    ID_TEST_CALLBACK_METHOD_RETURN,
     ID_TEST_GETURL,
     ID_TEST_DOM_ACCESS,
     ID_TEST_GET_URL_NOTIFY,
@@ -199,6 +200,7 @@ enum {
 static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS];
 static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
     "testCallback",
+    "testCallbackReturn",
     "getURL",
     "testDOMAccess",
     "getURLNotify",
@@ -483,6 +485,35 @@ static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argC
     return true;
 }
 
+static bool testCallbackReturn(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+    if (argCount != 1 || !NPVARIANT_IS_STRING(args[0]))
+        return false;
+
+    NPObject* windowScriptObject;
+    browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject);
+
+    NPUTF8* callbackString = createCStringFromNPVariant(&args[0]);
+    NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
+    free(callbackString);
+
+    NPVariant callbackArgs[1];
+    OBJECT_TO_NPVARIANT(windowScriptObject, callbackArgs[0]);
+
+    NPVariant browserResult;
+    browser->invoke(obj->npp, windowScriptObject, callbackIdentifier,
+                    callbackArgs, 1, &browserResult);
+
+    if (NPVARIANT_IS_OBJECT(browserResult))
+        OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(browserResult), *result);
+    else {
+        browser->releasevariantvalue(&browserResult);
+        VOID_TO_NPVARIANT(*result);
+    }
+
+    return true;
+}
+
 static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
     if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && NPVARIANT_IS_STRING(args[1])) {
@@ -894,6 +925,8 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
     PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
     if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD])
         return testCallback(plugin, args, argCount, result);
+    if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD_RETURN])
+        return testCallbackReturn(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_GETURL])
         return getURL(plugin, args, argCount, result);
     if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS])

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list