--- /dev/null
+/*
+Copyright (c) 2013 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:
+ Lin, Wanming <wanmingx.lin@intel.com>
+
+*/
+
+#content ul ul {
+ padding: 5px 15px;
+}
+
+.containing-element .ui-slider-switch { width: 8em }
+
+/*over write*/
+ul .ui-corner-all {
+ -moz-border-radius: 0 /*{global-radii-blocks}*/;
+ -webkit-border-radius: 0 /*{global-radii-blocks}*/;
+ border-radius: 0 /*{global-radii-blocks}*/;
+}
\ No newline at end of file
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width">
<link rel="stylesheet" type="text/css" href="../../css/jquery.mobile.css" />
+ <link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="../../js/thirdparty/jquery.js"></script>
<script src="../../js/thirdparty/jquery.mobile.js"></script>
<script src="../../js/tests.js"></script>
<div data-role="header">
<h1 id="main_page_title"></h1>
</div>
- <div data-role="content">
- <div data-role="collapsible-set" data-inset="false" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d">
- <div data-role="collapsible" data-collapsed="true">
- <h3 id="homeList">Home Directory</h3>
- <ul data-role="listview" data-split-icon="delete" data-split-theme="c" data-inset="true" id="home">
- <li class="ui-li ui-li-static" data-icon="false" data-theme="">
- <a href="#" align="center" id="homeBtn" data-rel="popup" data-position-to="window" data-transition="pop">Create file</a>
- </li>
- </ul>
- </div>
- <div data-role="collapsible" data-collapsed="true">
- <h3 id="mediaList">Shared Media Directory</h3>
- <ul data-role="listview" data-split-icon="delete" data-split-theme="c" data-inset="true" id="media">
- <li class="ui-li ui-li-static" data-icon="false" data-theme="">
- <a href="#" align="center" id="mediaBtn" data-rel="popup" data-position-to="window" data-transition="pop">Create file</a>
- </li>
- </ul>
- </div>
- <div data-role="collapsible" data-collapsed="true">
- <h3 id="systemList">Shared System Directory</h3>
- <ul data-role="listview" data-split-icon="delete" data-split-theme="c" data-inset="true" id="system">
- <li class="ui-li ui-li-static" data-icon="false" data-theme="">
- <a href="#" align="center" id="systemBtn" data-rel="popup" data-position-to="window" data-transition="pop">Create file</a>
- </li>
- </ul>
- </div>
- <div data-role="collapsible" data-collapsed="true">
- <h3>Etc Directory</h3>
- <ul data-role="listview" data-split-icon="delete" data-split-theme="c" data-inset="true" id="etc">
- <li class="ui-li ui-li-static" data-icon="false" data-theme="">
- <a href="#" align="center" id="etcBtn" data-rel="popup" data-position-to="window" data-transition="pop">Open Directory</a>
- </li>
- </ul>
- </div>
- </div>
+ <div id="content">
+ <ul data-role="listview">
+ <li data-role="list-divider">Home Directory</li>
+ <li><div data-role="button" id="openHomeBtn">Open Directory</div></li>
+ <li><div data-role="button" id="homeBtn">Create File</div></li>
+ <ul data-role="listview" id="home" data-inset="true"></ul>
+ </ul>
+ <ul data-role="listview">
+ <li data-role="list-divider">Shared Media Directory</li>
+ <li><div data-role="button" id="openMediaBtn">Open Directory</div></li>
+ <li><div data-role="button" id="mediaBtn">Create File</div></li>
+ <ul data-role="listview" id="media" data-inset="true"></ul>
+ </ul>
+ <ul data-role="listview">
+ <li data-role="list-divider">Shared System Directory</li>
+ <li><div data-role="button" id="openSystemBtn">Open Directory</div></li>
+ <li><div data-role="button" id="systemBtn">Create File</div></li>
+ <ul data-role="listview" id="system" data-inset="true"></ul>
+ </ul>
+ <ul data-role="listview" >
+ <li data-role="list-divider">Etc Directory</li>
+ <li><div data-role="button" id="openEtcBtn">Open Directory</div></li>
+ </ul>
</div>
<div data-role="footer" data-position="fixed">
</div>
<div data-role="popup" id="popup_info">
<font style="font-size:85%">
<p>Test Purpose: </p>
- <p>Verifies the "USER" of running Applications should be non-root ID and an application only allows user to manipulate files in the following locations: home directory, shared media directory, shared system directory. Get the "USER" info via cmdline "ps -aux | awk 'NR==tctbhtests.TCTBehaviorTests/'" in console. Manipulate files in home, shared media, shared system and etc directory through 4 buttons on the screen.</p>
+ <p>Verifies the "USER" of running Applications should be non-root ID and an application only allows user to manipulate files in the following locations: home directory, shared media directory, shared system directory. Get the "USER" info via cmdline "ps aux|awk 'NR==1;/tctbhtests\.TCTBehaviorTests/'" in console. Manipulate files in home, shared media, shared system and etc directory through 4 buttons on the screen.</p>
<p>Expected Result: </p>
<p>This test PASS only if the test Application runs under a non-root ID and user could manipulate files in home, shared media, shared system directory but not ect directory.</p>
</font>
+ '</h4></a><a href="'
+ 'javascript:deleteFile('
+ count
- + ')" data-rel="popup" data-position-to="window" data-transition="pop">'
+ + ')" data-icon="delete" data-theme="c">'
+ '</a></li>';
gFiles[count++] = files[i];
}
}
if (str) {
- $(selector).prepend(str).trigger("create").listview("refresh");
+ $(selector).append(str).trigger("create").listview("refresh");
}
}
try {
tizen.filesystem.resolve(str, function(dir) {
dir.listFiles(function(files) {
+ makeFileList(files, selector);
switch (str) {
- case "/home/": homeDir = dir; break;
- case "/opt/media/": mediaDir = dir; break;
- case "/usr/share/": systemDir = dir; break;
- case "/etc/": etcDir = dir; break;
+ case "/home/": {
+ homeDir = dir;
+ alert("Open Success");
+ break;
+ }
+ case "/opt/media/": {
+ mediaDir = dir;
+ alert("Open Success");
+ break;
+ }
+ case "/usr/share/": {
+ systemDir = dir;
+ alert("Open Success");
+ break;
+ }
+ case "/etc/": {
+ etcDir = dir;
+ alert("Open Success");
+ break;
+ }
default: break;
}
- makeFileList(files, selector);
- }, onError);
+ }, function(err) {
+ switch (str) {
+ case "/home/":
+ case "/opt/media/":
+ case "/usr/share/":
+ case "/etc/": {
+ alert("Open Fail: " + err.message);
+ break;
+ }
+ default: break;
+ }
+ });
}, onError, "rw");
} catch (exc) {
alert("tizen.filesystem.resolve(" + str + ") exc: " + exc.message);
+ '</h4></a><a href="'
+ 'javascript:deleteFile('
+ count
- + ')" data-rel="popup" data-position-to="window" data-transition="pop">'
+ + ')" data-icon="delete" data-theme="c">'
+ '</a></li>';
gFiles[count++] = newFile;
if (str) {
- $(selector).prepend(str).trigger("create").listview("refresh");
+ $(selector).append(str).trigger("create").listview("refresh");
}
} catch (exc) {
alert("Create File Error: " + exc.message);
checkEnable();
});
- $("#etcBtn").on("click",function() {
- if (!etcDir) {
- openDirectory("/etc/", "#etc");
- etcFlag = true;
- checkEnable();
- }
- });
- $("#homeList").on("click",function() {
- if (!homeDir && ($(this).parent().attr("class") == "ui-collapsible")) {
+ $("#openHomeBtn").on("click",function() {
+ if (!homeDir) {
openDirectory("/home/", "#home");
+ } else {
+ alert("Already Opened");
}
});
- $("#mediaList").on("click",function() {
- if (!mediaDir && ($(this).parent().attr("class") == "ui-collapsible")) {
+ $("#openMediaBtn").on("click",function() {
+ if (!mediaDir) {
openDirectory("/opt/media/", "#media");
+ } else {
+ alert("Already Opened");
}
});
- $("#systemList").on("click",function() {
- if (!systemDir && ($(this).parent().attr("class") == "ui-collapsible")) {
+ $("#openSystemBtn").on("click",function() {
+ if (!systemDir) {
openDirectory("/usr/share/", "#system");
+ } else {
+ alert("Already Opened");
+ }
+ });
+ $("#openEtcBtn").on("click",function() {
+ if (!etcDir) {
+ openDirectory("/etc/", "#etc");
+ etcFlag = true;
+ checkEnable();
}
});
if (homeDir && mediaDir && systemDir && etcFlag) {
EnablePassButton();
}
-}
\ No newline at end of file
+}