[common][screenorientation][Change path for supporting global user and sync test... 87/111287/1
authormengli.zhang <mengli.zhang@samsung.com>
Fri, 20 Jan 2017 17:50:24 +0000 (12:50 -0500)
committermengli.zhang <mengli.zhang@samsung.com>
Fri, 20 Jan 2017 17:50:28 +0000 (12:50 -0500)
Change-Id: I44c759a34629df7b276a6be55b3cbfafa99f3de8
Signed-off-by: mengli.zhang <mengli.zhang@samsung.com>
common/tct-screenorientation-w3c-tests/inst.wgt.py
common/tct-screenorientation-w3c-tests/resources/sandboxed-iframe-locking.html
common/tct-screenorientation-w3c-tests/screenorientation/ScreenOrientation_angle_readonly.html

index 5b1718da169ebc796a16962b47a209f160af24d9..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -20,7 +20,15 @@ tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
+EXECUTION_MODE_30 = tct_parser.get('DEVICE', 'DEVICE_EXECUTION_MODE_30')
+ADMIN_USER_30 = tct_parser.get('DEVICE', 'DEVICE_ADMIN_USER_30')
 
+def userCheck():
+    global GLOVAL_OPT
+    if ADMIN_USER_30 == EXECUTION_MODE_30:
+        GLOVAL_OPT="--global"
+    else:
+        GLOVAL_OPT=""
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
@@ -116,7 +124,7 @@ def uninstPKGs():
                     action_status = False
                     continue
                 (return_code, output) = doRemoteCMD(
-                    "pkgcmd -u -t wgt -q -n %s" % pkg_id)
+                    "pkgcmd %s -u -t wgt -q -n %s" % (GLOVAL_OPT, pkg_id))
                 for line in output:
                     if "Failure" in line:
                         action_status = False
@@ -145,7 +153,7 @@ def instPKGs():
                 if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)):
                     action_status = False
                 (return_code, output) = doRemoteCMD(
-                    "pkgcmd -i -t wgt -q -p %s/%s" % (SRC_DIR, file))
+                    "pkgcmd %s -i -t wgt -q -p %s/%s" % (GLOVAL_OPT, SRC_DIR, file))
                 doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file))
                 for line in output:
                     if "Failure" in line:
@@ -187,7 +195,7 @@ def main():
         sys.exit(1)
 
     if not PARAMETERS.user:
-        PARAMETERS.user = "owner"
+        PARAMETERS.user = EXECUTION_MODE_30
     if not PARAMETERS.mode:
         PARAMETERS.mode = "SDB"
 
@@ -205,6 +213,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
index 74dac82a5b05e2b64feed60ad5bb6579b9008647..92f709a1e5dcf9ce4062a597da5e7eaea81b3d1e 100755 (executable)
@@ -13,6 +13,6 @@
     // That should be removed as soon as we get a resolved promise in tests.
     setTimeout(function() {
         parent.window.postMessage(msg, "*");
-    })
+    },100);
 </script>
 </html>
index e600a47609d189ec38b5be31b9401984ff460c57..4cef1be6a2953cf0b44ed44241abbb91053596b5 100755 (executable)
@@ -33,9 +33,15 @@ Author:
     <script>
         test(function() {
             var screenOrientation = window.screen.orientation;
-            screenOrientation.angle = 270;
-            assert_not_equals(screenOrientation.angle, 270);
+            if(screenOrientation == 270) {
+                screenOrientation.angle = 180;
+                assert_not_equals(screenOrientation.angle, 180);              
+                }
+            else{
+                screenOrientation.angle = 270;
+                assert_not_equals(screenOrientation.angle, 270);
+                }
         }, "Check that screenOrientation.angle is readonly");
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>