[common][webgl][change path for supporting global user and add 1 TC] 19/111319/1
authorwei.ji <wei.ji@samsung.com>
Fri, 20 Jan 2017 06:34:24 +0000 (14:34 +0800)
committerwei.ji <wei.ji@samsung.com>
Fri, 20 Jan 2017 06:34:37 +0000 (14:34 +0800)
- add 1 tc "webglrenderingcontext_VIEWPORT_exists"
- change path for supporting global user in inst.wgt.py

Change-Id: Icc29d83f055a698f8289669447da8f9d3b4457cd
Signed-off-by: wei.ji <wei.ji@samsung.com>
common/tct-webgl-nonw3c-tests/inst.wgt.py
common/tct-webgl-nonw3c-tests/webgl/webglrenderingcontext_VIEWPORT_exists.html [new file with mode: 0755]

index e735a701d191af9d46c1bc359534ec457240587f..dd614f26548aab1c49ce4a34e3e02b05ef5e4971 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option\r
+from optparse import OptionParser, make_option
 import ConfigParser
 
 
@@ -20,6 +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):
@@ -55,8 +64,6 @@ def getUSERID():
     return doCMD(cmd)
 
 
-
-
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -113,7 +120,7 @@ def uninstPKGs():
                     action_status = False
                     continue
                 (return_code, output) = doRemoteCMD(
-                    "pkgcmd -u -t wgt -q -n %s" % pkg_id)
+                    "pkgcmd %s -q -u -n %s" % (GLOVAL_OPT, pkg_id))
                 for line in output:
                     if "Failure" in line:
                         action_status = False
@@ -139,7 +146,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:
@@ -181,7 +188,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"
 
@@ -198,7 +205,9 @@ def main():
     if not PARAMETERS.device:
         print "No device provided"
         sys.exit(1)
-
+    
+    userCheck()
+    
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
diff --git a/common/tct-webgl-nonw3c-tests/webgl/webglrenderingcontext_VIEWPORT_exists.html b/common/tct-webgl-nonw3c-tests/webgl/webglrenderingcontext_VIEWPORT_exists.html
new file mode 100755 (executable)
index 0000000..0955c7a
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification, 
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list 
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice, 
+  this list of conditions and the following disclaimer in the documentation 
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors 
+  may be used to endorse or promote products derived from this work without 
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" 
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, 
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+  
+Authors:
+         Cao, Jun <junx.cao@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>WebGL Test: webglrenderingcontext_VIEWPORT_exists</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="https://www.khronos.org/registry/webgl/specs/1.0/" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if WebGLRenderingContext.VIEWPORT exists"/>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+    <script src="support/webgl.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <canvas id="canvas" width="200" height="100" style="border:1px solid #c3c3c3;">
+      Your browser does not support the canvas element.
+    </canvas>
+    <script type="text/javascript">
+        getwebgl();
+        webgl_property_exists(webgl, 'VIEWPORT');
+    </script>
+  </body>
+</html>