Bug 1342141 part B - The test plugin will use name="plugin" as an indicator of fullpage, rather than NP_FULL, to make test_fullpage.html green, r?jimm draft
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 23 Feb 2017 13:07:34 -0500
changeset 488770 bc1b57ae9579098d8a2d2fe7c3bbe395a9ab5ed6
parent 488754 74c556c04e56ae7e5d6c5cd8f42f49f358864bac
child 546825 0a66f918f3eda748e54f5ec02fd39967f0924bac
push id46630
push userbsmedberg@mozilla.com
push dateThu, 23 Feb 2017 18:08:07 +0000
reviewersjimm
bugs1342141
milestone54.0a1
Bug 1342141 part B - The test plugin will use name="plugin" as an indicator of fullpage, rather than NP_FULL, to make test_fullpage.html green, r?jimm MozReview-Commit-ID: D7HVr9f37se
dom/plugins/test/testplugin/nptest.cpp
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -871,22 +871,16 @@ NPP_New(NPMIMEType pluginType, NPP insta
   }
   scriptableObject->npp = instance;
   scriptableObject->drawMode = DM_DEFAULT;
   scriptableObject->drawColor = 0;
   instanceData->scriptableObject = scriptableObject;
 
   instanceData->instanceCountWatchGeneration = sCurrentInstanceCountWatchGeneration;
 
-  if (NP_FULL == mode) {
-    instanceData->streamMode = NP_SEEK;
-    instanceData->frame = "testframe";
-    addRange(instanceData, "100,100");
-  }
-
   AsyncDrawing requestAsyncDrawing = AD_NONE;
 
   bool requestWindow = false;
   bool alreadyHasSalign = false;
   // handle extra params
   for (int i = 0; i < argc; i++) {
     if (strcmp(argn[i], "drawmode") == 0) {
       if (strcmp(argv[i], "solid") == 0)
@@ -1010,17 +1004,26 @@ NPP_New(NPMIMEType pluginType, NPP insta
       if (alreadyHasSalign) {
         // If salign came before this parameter, error out now.
         return NPERR_GENERIC_ERROR;
       }
     }
     if (strcmp(argn[i], "salign") == 0) {
       alreadyHasSalign = true;
     }
-}
+
+    // We don't support NP_FULL any more, but name="plugin" is an indication
+    // that we're a full-page plugin. We use default seek parameters for
+    // test_fullpage.html
+    if (strcmp(argn[i], "name") == 0 && strcmp(argv[i], "plugin") == 0) {
+      instanceData->streamMode = NP_SEEK;
+      instanceData->frame = "testframe";
+      addRange(instanceData, "100,100");
+    }
+  }
 
   if (!browserSupportsWindowless || !pluginSupportsWindowlessMode()) {
     requestWindow = true;
   } else if (!pluginSupportsWindowMode()) {
     requestWindow = false;
   }
   if (requestWindow) {
     instanceData->hasWidget = true;