[VD] Support RWI feature 55/207855/8
authorliwei <wei90727.li@samsung.com>
Thu, 13 Jun 2019 08:43:09 +0000 (16:43 +0800)
committerliwei <wei90727.li@samsung.com>
Mon, 24 Jun 2019 07:40:19 +0000 (15:40 +0800)
1. When set vconf "db/rwi/inspected_appid" to appid or __AUL_DEBUG__
   is 1, RWI feature will be started.
   (i.e. vconftool set -t string db/rwi/inspected_appid "zLNL5kc4kl.emanual"
         -f -g 5000
         aul_test launch zLNL5kc4kl.emanual __AUL_DEBUG__ 1)
2. Support popup to show port number when appid is set to vconf.

Native side link:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/207831/

Change-Id: Id7d640b1fd690cce9695fe4c552be7fbe7ed5c90
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/src/runtime.js [changed mode: 0755->0644]
wrt_app/src/web_application.js [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 8fcdcf1..d7daa36
@@ -30,6 +30,7 @@ class Runtime {
         this.extensionManager = null;
         this.isLaunched = false;
         this.debug_mode = false;
+        this.need_inspector = false;
 
         var _this = this;
         app.on('before-quit', function(event) {
@@ -143,8 +144,8 @@ class Runtime {
             // FIX ME : It must be supplemented to set a specific path
             wrt.setCookiePath();
 
-            // AUL public key - To support debug argument
-            if (!_this.debug_mode && appControl.getData('__AUL_DEBUG__') == "1") {
+            // AUL public key/Vconf - To support inspector
+            if (!_this.debug_mode && _this.checkInspectorCondition(appControl)) {
                 _this.debug_mode = true;
                 _this.launchInspector(appControl);
             }
@@ -189,8 +190,19 @@ class Runtime {
             return _this.extensionManager.deactivate(app, name);
         });
     }
+    checkInspectorCondition(appControl) {
+        var _this = this;
+        let bundle_debug = (appControl.getData('__AUL_DEBUG__') === "1");
+        _this.need_inspector =  wrt.needUseInspector();
+        return (bundle_debug || _this.need_inspector);
+    }
     launchInspector(appControl) {
-        var data = { "port" :  [ wrt.getDebuggingPort().toString() ] };
+        var _this   = this;
+        var portnum = wrt.getDebuggingPort();
+        var data    = { "port" :  [ portnum.toString() ] };
+        if(_this.need_inspector) {
+            _this.webApplication.debugport = portnum;
+        }
         appControl.reply(data);
     }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 3f242e9..2c35351
@@ -32,6 +32,7 @@ class WebApplication {
         this.firstRendered = false;
         this.backgroundSupport = wrt.getBackgroundSupport();
         this.multitaskingSupport = wrt.getMultitaskingSupport();
+        this.debugport = 0;
         if (options.launchMode == 'backgroundAtStartup') {
             console.log('backgroundAtStartup');
             this.preloadState = 'preload';
@@ -228,6 +229,11 @@ class WebApplication {
                 if (self.runningStatus !== 'behind')
                     wrt.notifyAppStatus('preload');
             }
+            if((self.debugport) && (wrt.getPlatformType() === "product_tv")) {
+                const kDebugPopupScript = "alert('port number :" + self.debugport +"')";
+                wrt.executeJS(self.mainWindow.webContents, kDebugPopupScript);
+                self.debugport = 0;
+            }
         });
     }
     suspend() {