[mobile,tv][Clipboard,DragandDrop][Fix test package install path issue] 97/187697/1
authorzhongyuan <zy123.yuan@samsung.com>
Tue, 28 Aug 2018 02:48:23 +0000 (10:48 +0800)
committerzhongyuan <zy123.yuan@samsung.com>
Tue, 28 Aug 2018 02:48:23 +0000 (10:48 +0800)
Change-Id: Ic8d3bebfcfed70f1a2f00581a6b35f9a8cffb343

mobile/tct-behavior-tests/tests/Clipboard/js/main.js
mobile/tct-behavior-tests/tests/DragandDrop/js/main.js
tv/tct-behavior-tests/tests/Clipboard/js/main.js
tv/tct-behavior-tests/tests/DragandDrop/js/main.js

index e887a94..3fdd20f 100755 (executable)
@@ -28,6 +28,17 @@ Authors:
         Tan, Shiyou <shiyoux.tan@intel.com>
 */
 
+var RESOURCE_DIR;
+$.ajax({
+  url:"/opt/usr/home/owner/share/TCT_CONFIG",
+  data:{},
+  async:false,
+  success:function(data){
+    var regEx = /DEVICE_SUITE_TARGET_30=(.+)/i;
+    var path = regEx.exec(data);
+    RESOURCE_DIR = path[1];
+  }
+});
 var installUrl;
 $(document).delegate("#main", "pageinit", function() {
     DisablePassButton();
@@ -86,7 +97,7 @@ function fileURI() {
     }
 
     tizen.filesystem.resolve(
-            'documents',
+            'file://' + RESOURCE_DIR + '/Documents',
             function(dir){
                 documentsDir = dir;
                 dir.listFiles(onsuccess, onerror);
@@ -178,7 +189,7 @@ function packagePre() {
             {
                 documentsDir.copyTo(
                     files[i].fullPath,
-                    "documents/Clipboard.wgt",
+                    "file://" + RESOURCE_DIR + "/Documents/Clipboard.wgt",
                     true,
                     function() {
                         console.log("Clipboard Precondition Success(2)!");
index 0dd8e11..f74bd9f 100755 (executable)
@@ -28,6 +28,17 @@ Authors:
         Tan, Shiyou <shiyoux.tan@intel.com>
 */
 
+var RESOURCE_DIR;
+$.ajax({
+  url:"/opt/usr/home/owner/share/TCT_CONFIG",
+  data:{},
+  async:false,
+  success:function(data){
+    var regEx = /DEVICE_SUITE_TARGET_30=(.+)/i;
+    var path = regEx.exec(data);
+    RESOURCE_DIR = path[1];
+  }
+});
 var installUrl;
 $(document).delegate("#main", "pageinit", function() {
     DisablePassButton();
@@ -87,7 +98,7 @@ function fileURI() {
     }
 
     tizen.filesystem.resolve(
-            'documents',
+            'file://' + RESOURCE_DIR + '/Documents',
             function(dir){
                 documentsDir = dir;
                 dir.listFiles(onsuccess, onerror);
@@ -180,7 +191,7 @@ function packagePre() {
             {
                 documentsDir.copyTo(
                     files[i].fullPath,
-                    "documents/DragandDrop.wgt",
+                    "file://" + RESOURCE_DIR + "/Documents/DragandDrop.wgt",
                     true,
                     function() {
                         console.log("DragandDrop Precondition Success(2)!");
index e887a94..3fdd20f 100755 (executable)
@@ -28,6 +28,17 @@ Authors:
         Tan, Shiyou <shiyoux.tan@intel.com>
 */
 
+var RESOURCE_DIR;
+$.ajax({
+  url:"/opt/usr/home/owner/share/TCT_CONFIG",
+  data:{},
+  async:false,
+  success:function(data){
+    var regEx = /DEVICE_SUITE_TARGET_30=(.+)/i;
+    var path = regEx.exec(data);
+    RESOURCE_DIR = path[1];
+  }
+});
 var installUrl;
 $(document).delegate("#main", "pageinit", function() {
     DisablePassButton();
@@ -86,7 +97,7 @@ function fileURI() {
     }
 
     tizen.filesystem.resolve(
-            'documents',
+            'file://' + RESOURCE_DIR + '/Documents',
             function(dir){
                 documentsDir = dir;
                 dir.listFiles(onsuccess, onerror);
@@ -178,7 +189,7 @@ function packagePre() {
             {
                 documentsDir.copyTo(
                     files[i].fullPath,
-                    "documents/Clipboard.wgt",
+                    "file://" + RESOURCE_DIR + "/Documents/Clipboard.wgt",
                     true,
                     function() {
                         console.log("Clipboard Precondition Success(2)!");
index 0dd8e11..f74bd9f 100755 (executable)
@@ -28,6 +28,17 @@ Authors:
         Tan, Shiyou <shiyoux.tan@intel.com>
 */
 
+var RESOURCE_DIR;
+$.ajax({
+  url:"/opt/usr/home/owner/share/TCT_CONFIG",
+  data:{},
+  async:false,
+  success:function(data){
+    var regEx = /DEVICE_SUITE_TARGET_30=(.+)/i;
+    var path = regEx.exec(data);
+    RESOURCE_DIR = path[1];
+  }
+});
 var installUrl;
 $(document).delegate("#main", "pageinit", function() {
     DisablePassButton();
@@ -87,7 +98,7 @@ function fileURI() {
     }
 
     tizen.filesystem.resolve(
-            'documents',
+            'file://' + RESOURCE_DIR + '/Documents',
             function(dir){
                 documentsDir = dir;
                 dir.listFiles(onsuccess, onerror);
@@ -180,7 +191,7 @@ function packagePre() {
             {
                 documentsDir.copyTo(
                     files[i].fullPath,
-                    "documents/DragandDrop.wgt",
+                    "file://" + RESOURCE_DIR + "/Documents/DragandDrop.wgt",
                     true,
                     function() {
                         console.log("DragandDrop Precondition Success(2)!");