Fix plugin test suite

Change-Id: Idbbcab85f0371e798fa7fe56d6a84fd65a86a9cd
diff --git a/dev/js/src/plugin/widget.js b/dev/js/src/plugin/widget.js
index 17c1f5e..dbdeee9 100644
--- a/dev/js/src/plugin/widget.js
+++ b/dev/js/src/plugin/widget.js
@@ -66,9 +66,13 @@
       this.show().style.height = data.height + 'px';
     },
 
-    // Shutdown suspicious iframe
-    shutdown : function () {
-      this.element().parentNode.removeChild(this.element());
+
+    // On closing the widget view
+    onClose : function () {
+      if (this._mgr) {
+        this._mgr._closeWidget(this._id);
+        this._mgr = undefined;
+      };
     }
   }
 });