--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>File Writer Test: BlobBuilder_constructor_visible_in_window</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#idl-def-BlobBuilder" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if BlobBuilder constructor must be visible when the script's global object is a Window object" />
+ <script src="support/support.js"></script>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ try {
+ var blob = initBlobBuilder();
+ t.step(function () {
+ assert_true(blob != null, "WorkerUtils.BlobBuilder exists");
+ });
+ t.done();
+ } catch (ex) {
+ t.step(function () {
+ assert_true(false, "Throw an exception " + ex);
+ });
+ t.done();
+ }
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Ge, Qing <qingx.ge@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>File Writer Test: BlobBuilder_getBlob_string_type</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-BlobBuilder-getBlob" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if BlobBuilder.getBlob method set 'text/plain', then compare blobBuilder.getBlob().type is 'text/plain'" />
+ <script src="support/support.js"></script>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ t.step(function () {
+ try {
+ var bb = initBlobBuilder();
+ var type = bb.getBlob("text/plain").type;
+ assert_equals(type, "text/plain");
+ } catch (e) {
+ assert_false(true, e.message);
+ }
+ }, "compare blobBuilder.getBlob().type is 'text/plain'");
+ t.done();
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title >File Writer Test: FileSaver_const_DONE_type </title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-DONE" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the type of const DONE is number" />
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function() {
+ assert_true(false, e.name);
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024,
+ function(fs) {
+ fs.root.getFile('seek_log.txt', {create: true},
+ function(fileEntry) {
+ fileEntry.createWriter(function(fileWriter) {
+ t.step(function() {
+ assert_true(typeof fileWriter.DONE == "number", "The type of const DONE is number");
+ });
+ t.done();
+ },errorCallback);
+ },errorCallback);
+ },errorCallback);
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title >File Writer Test: FileSaver_const_INIT_type </title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-INIT" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the type of const INIT is number" />
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function() {
+ assert_true(false, e.name);
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024,
+ function(fs) {
+ fs.root.getFile('seek_log.txt', {create: true},
+ function(fileEntry) {
+ fileEntry.createWriter(function(fileWriter) {
+ t.step(function() {
+ assert_true(typeof fileWriter.INIT == "number", "The type of const INIT is number");
+ });
+ t.done();
+ },errorCallback);
+ },errorCallback);
+ },errorCallback);
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title >File Writer Test: FileSaver_error_type </title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-error" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the type of FileSaver.error is FileError" />
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function () {
+ assert_true(e.toString() == "[object FileError]", "The type of FileSaver.error is FileError");
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024, function (fs) {
+ fs.root.getFile(null, {create: true}, function (fileEntry) {
+ fileEntry.createWriter(function (fileWriter) {
+ t.step(function () {
+ assert_false(true, "The type of FileSaver.error should be FileError");
+ });
+ t.done();
+ }, errorCallback);
+ }, errorCallback);
+ }, errorCallback);
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title >File Writer Test: FileSaver_onabort_event_type </title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-onabort" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Ckeck if the event type of FileSaver.onabort is abort" />
+ <script src="support/support.js"></script>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function() {
+ assert_true(false, e.name);
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024,
+ function(fs) {
+ fs.root.getFile('seek_log.txt', {create: true},
+ function(fileEntry) {
+ fileEntry.createWriter(function(fileWriter) {
+ var bb = initBlobBuilder();
+ fileWriter.onwritestart = function (e) {
+ fileWriter.abort();
+ };
+ fileWriter.onabort = function(event) {
+ t.step(function() {
+ assert_true(event.type == "abort", "The event type of FileSaver.onabort should be abort");
+ });
+ t.done();
+ };
+ bb.append('test case');
+ fileWriter.write(bb.getBlob());
+ },errorCallback);
+ },errorCallback);
+ },errorCallback);
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>File Writer Test: FileWriter_length_normal</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileWriter-length" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the value of FileWriter.length attribute is normal" />
+ <script src="support/support.js"></script>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var initial_length = 0;
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function() {
+ assert_true(false, e.name);
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024, function (fs) {
+ fs.root.getFile('log.txt', {create: true}, function (fileEntry) {
+ fileEntry.createWriter(function (fileWriter) {
+ var bb = initBlobBuilder();
+ bb.append('the value of FileWriter.length attribute is normal');
+ t.step(function () {
+ initial_length = fileWriter.length;
+ assert_equals(fileWriter.length, initial_length);
+ });
+ t.done();
+ fileWriter.write(bb.getBlob('text/plain'));
+ }, errorCallback);
+ }, errorCallback);
+ }, errorCallback);
+ </script>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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:
+ Liu,Chunting <chuntingx.liu@intel.com>
+ Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>File Writer Test: FileWriter_position_normal</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileWriter-position" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the value of FileWriter.position attribute is normal" />
+ <script src="support/support.js"></script>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var initial_position = 0;
+ var t = async_test(document.title, {timeout:2000});
+ function errorCallback(e) {
+ t.step(function() {
+ assert_true(false, e.name);
+ });
+ t.done();
+ }
+ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+ if (!window.requestFileSystem) {
+ t.step(function() {
+ assert_true(false, "the browser does not support requestFileSystem");
+ });
+ t.done();
+ }
+ requestFileSystem(TEMPORARY, 1024*1024, function (fs) {
+ fs.root.getFile('log.txt', {create: true}, function (fileEntry) {
+ fileEntry.createWriter(function (fileWriter) {
+ var bb = initBlobBuilder();
+ bb.append('the value of FileWriter.position attribute is normal');
+ fileWriter.seek(5);
+ t.step(function () {
+ initial_position = fileWriter.position;
+ assert_equals(fileWriter.position, initial_position);
+ });
+ t.done();
+ fileWriter.write(bb.getBlob('text/plain'));
+ }, errorCallback);
+ }, errorCallback);
+ }, errorCallback);
+ </script>
+ </body>
+</html>
</spec>
</specs>
</testcase>
+ <testcase purpose="Check if BlobBuilder constructor must be visible when the script's global object is a Window object" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P3" id="BlobBuilder_constructor_visible_in_window">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if BlobBuilder constructor must be visible when the script's global object is a Window object</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/BlobBuilder_constructor_visible_in_window.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="BlobBuilder" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#idl-def-BlobBuilder</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if BlobBuilder.getBlob method set 'text/plain', then compare blobBuilder.getBlob().type is 'text/plain'" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="BlobBuilder_getBlob_string_type">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if BlobBuilder.getBlob method set 'text/plain', then compare blobBuilder.getBlob().type is 'text/plain'</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/BlobBuilder_getBlob_string_type.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="method" element_name="getBlob" interface="BlobBuilder" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-BlobBuilder-getBlob</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if the type of const DONE is number" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileSaver_const_DONE_type">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if the type of const DONE is number</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileSaver_const_DONE_type.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="attribute" element_name="DONE" interface="FileSaver" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-DONE</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if the type of const INIT is number" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileSaver_const_INIT_type">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if the type of const INIT is number</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileSaver_const_INIT_type.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="attribute" element_name="INIT" interface="FileSaver" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-INIT</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if the type of FileSaver.error is FileError" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileSaver_error_type">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if the type of FileSaver.error is FileError</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileSaver_error_type.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="attribute" element_name="error" interface="FileSaver" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-error</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Ckeck if the event type of FileSaver.onabort is abort" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileSaver_onabort_event_type">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Ckeck if the event type of FileSaver.onabort is abort</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileSaver_onabort_event_type.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="eventhandler" element_name="onabort" interface="FileSaver" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileSaver-onabort</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if the value of FileWriter.length attribute is normal" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileWriter_length_normal">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if the value of FileWriter.length attribute is normal</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileWriter_length_normal.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="attribute" element_name="length" interface="FileWriter" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileWriter-length</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if the value of FileWriter.position attribute is normal" type="compliance" status="approved" component="WebAPI/Storage/File API: Writer (Partial)" execution_type="auto" priority="P2" id="FileWriter_position_normal">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if the value of FileWriter.position attribute is normal</step_desc>
+ <expected>pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-filewriterapi-w3c-tests/filewriterapi/FileWriter_position_normal.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion element_type="attribute" element_name="position" interface="FileWriter" specification="File API: Writer (Partial)" section="Storage" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2011/WD-file-writer-api-20110419/#widl-FileWriter-position</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
</set>
</suite>
</test_definition>