<title>FileSystemManager_toURI</title>
<meta charset="utf-8"/>
<script src="support/unitcommon.js"></script>
+<script src="support/filesystem_common.js"></script>
</head>
<body>
<div id="log"></div>
//==== TEST_CRITERIA MR
test(function () {
- var retVal;
+ var retVal, uri = "documents/directory/file.ext", expect = "file://" + CONTENT_DIR + "/Documents/directory/file.ext";
- retVal = tizen.filesystem.toURI("documents/directory/file.ext");
+ retVal = tizen.filesystem.toURI(uri);
assert_type(retVal, "string", "The type of return value should be string.");
- assert_equals(retVal, "file:///opt/usr/home/owner/media/Documents/directory/file.ext", "Path is not successfully converted to file URI");
+ assert_equals(retVal, expect, "Path is not successfully converted to file URI");
}, document.title);
</script>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2018 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Authors:
- Qunfang Lin <qunfang.lin@samsung.com>
-
--->
-
-<html>
-<head>
-<title>FileSystemManager_toURI_tv</title>
-<meta charset="utf-8"/>
-<script src="support/unitcommon.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-//==== TEST: FileSystemManager_toURI_tv
-//==== LABEL Check if FileSystemManager::toURI() method works properly
-//==== SPEC Tizen Web API:IO:Filesystem:FileSystemManager:toURI M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/filesystem.html
-//==== PRIORITY P1
-//==== TEST_CRITERIA MR
-
-test(function () {
- var retVal;
-
- retVal = tizen.filesystem.toURI("documents/directory/file.ext");
- assert_type(retVal, "string", "The type of return value should be string.");
- assert_equals(retVal, "file:///opt/usr/home/owner/content/Documents/directory/file.ext", "Path is not successfully converted to file URI");
-}, document.title);
-
-</script>
-</body>
-</html>
var globalCounter = 1;
+var CONTENT_DIR = "";
+document.write('<script src="../webrunner/jquery-1.10.2.min.js"></script>');
+document.write('<script src="support/getJsonConf.js"></script>');
+
function isFileObject(obj) {
return true;
}
--- /dev/null
+/*\r
+Copyright (c) 2013 Intel Corporation.\r
+\r
+Redistribution and use in source and binary forms, with or without modification,\r
+are permitted provided that the following conditions are met:\r
+\r
+* Redistributions of works must retain the original copyright notice, this list\r
+ of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the original copyright notice,\r
+ this list of conditions and the following disclaimer in the documentation\r
+ and/or other materials provided with the distribution.\r
+* Neither the name of Intel Corporation nor the names of its contributors\r
+ may be used to endorse or promote products derived from this work without\r
+ specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Authors:\r
+ Li, Hao <haox.li@intel.com>\r
+\r
+*/\r
+var RESOURCE_DIR;\r
+$.ajax({\r
+ url:"/opt/usr/home/owner/share/TCT_CONFIG",\r
+ data:{},\r
+ async:false,\r
+ success:function(data){\r
+ var regEx2 = /DEVICE_STORAGE_30=(.+)/i;\r
+ var path2 = regEx2.exec(data);\r
+ CONTENT_DIR = path2[1];\r
+ }\r
+});\r
+\r
<test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_rename_with_errorCallback.html</test_script_entry>
</description>
</testcase>
+ <testcase purpose="Check if FileSystemManager::toURI() method works properly" component="TizenAPI/IO/Filesystem" execution_type="auto" priority="P1" id="FileSystemManager_toURI">
+ <description>
+ <test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_toURI.html</test_script_entry>
+ </description>
+ </testcase>
<testcase purpose="Check if FileSystemManager::toURI() method with invalid path throws InvalidValuesError" component="TizenAPI/IO/Filesystem" execution_type="auto" priority="P2" id="FileSystemManager_toURI_InvalidValuesError">
<description>
<test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_toURI_InvalidValuesError.html</test_script_entry>
<test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_resolve_ringtones_invalid_mode_w.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check if FileSystemManager::toURI() method works properly" component="TizenAPI/IO/Filesystem" execution_type="auto" priority="P1" id="FileSystemManager_toURI">
- <description>
- <test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_toURI.html</test_script_entry>
- </description>
- </testcase>
</set>
<set name="Filesystem_wearable" type="js">
<capabilities>
<test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_resolve_ringtones_invalid_mode_w.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check if FileSystemManager::toURI() method works properly" component="TizenAPI/IO/Filesystem" execution_type="auto" priority="P1" id="FileSystemManager_toURI">
- <description>
- <test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_toURI.html</test_script_entry>
- </description>
- </testcase>
</set>
<set name="Filesystem_tv" type="js">
<capabilities>
<test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_removeStorageStateChangeListener_with_para_invalid.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check if FileSystemManager::toURI() method works properly" component="TizenAPI/IO/Filesystem" execution_type="auto" priority="P1" id="FileSystemManager_toURI_tv">
- <description>
- <test_script_entry>/opt/tct-filesystem-tizen-tests/filesystem/FileSystemManager_toURI_tv.html</test_script_entry>
- </description>
- </testcase>
</set>
</suite>
</test_definition>