Don't require the plugin to always use the same NPP struct we gave it in NPP_New

Neither WebCore, nor WebKit/mac, nor Firefox requires this, and
Shockwave (at least) seems to use a different NPP struct that contains
the same ndata member. So we shouldn't enforce it, either.

Fixes <http://webkit.org/b/47690> <rdar://problem/8553020> Assertion
failure in NetscapePlugin::fromNPP when using Shockwave in WebKit2

Reviewed by John Sullivan.

WebKit2:

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::fromNPP): Removed the bogus assertion.

WebKitTools:

Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure

* DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.
(PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
members.
(PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
browser than the one it gave us in NPP_New and see if it works.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
Added PassDifferentNPPStruct.

LayoutTests:

Test that passing a different NPP struct back to the browser doesn't
cause an assertion failure

* plugins/pass-different-npp-struct-expected.txt: Added.
* plugins/pass-different-npp-struct.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/plugins/pass-different-npp-struct.html b/LayoutTests/plugins/pass-different-npp-struct.html
new file mode 100644
index 0000000..3869bd0
--- /dev/null
+++ b/LayoutTests/plugins/pass-different-npp-struct.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<body>
+<embed id="testPlugin" 
+       type="application/x-webkit-test-netscape"
+       src="data:text/plain,"
+       test="pass-different-npp-struct">
+</embed>
+
+<div>
+    This tests that no assertions fire when a plugin passes a different NPP struct to one of the NPN* functions (specifically, NPN_GetValue).
+</div>
+<script>
+  if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+</script>
+</body>
+</html>
+