[Filesystem] TYPE_MISMATCH_EXCEPTION in assert_throws()
authorPiotr Szydelko <p.szydelko@samsung.com>
Tue, 8 Oct 2013 12:51:51 +0000 (14:51 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 8 Oct 2013 14:05:22 +0000 (14:05 +0000)
Change-Id: I4eccd5d55f6705115e72c4f836c909e69e1793f8

27 files changed:
tct-filesystem-tizen-tests/filesystem/FileSystemManager_addStorageStateChangeListener_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_addStorageStateChangeListener_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_getStorage_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_getStorage_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_listStorages_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_listStorages_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_listStorages_with_invalid_error_callbacks.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_resolve_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_resolve_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/FileSystemManager_resolve_works_correctly.html
tct-filesystem-tizen-tests/filesystem/File_copyTo_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_copyTo_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_deleteDirectory_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_deleteDirectory_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_deleteFile_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_deleteFile_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_listFiles.html
tct-filesystem-tizen-tests/filesystem/File_listFiles_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_listFiles_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_moveTo_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_moveTo_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_openStream_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_openStream_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_readAsText_onerror_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_readAsText_onsuccess_invalid_cb.html
tct-filesystem-tizen-tests/filesystem/File_readAsText_with_encoding.html
tct-filesystem-tizen-tests/filesystem/File_readAsText_with_onerror.html

index 77e35e5593806078425f5cd52fc49c05007f198d..c7dd17c6cd9dcbb5ebb39c288343b44ba31e2b5f 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 
 //  Check argument onError validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", incorrectCallback, onSuccess;
+    incorrectCallback, onSuccess;
 t.step(function () {
     onSuccess = t.step_func(function (storage) {
         assert_unreached("onSuccess callback invoked");
@@ -47,10 +47,10 @@ t.step(function () {
             assert_unreached("invalid callback invoked");
         })
     };
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.addStorageStateChangeListener(onSuccess, incorrectCallback);
-        }, exceptionName + " should be thrown - given incorrect error callback.");
+        }, "given incorrect errorCallback");
     t.done();
 });
 
index 85beff561d9893189b98f7120f43f82f4b41efee..f4d2db2a05d2f5a302aa50be413f08280bed470c 100644 (file)
@@ -38,7 +38,7 @@ Authors:
 
 //  Check argument onSuccess validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", incorrectCallback;
+    incorrectCallback;
 
 t.step(function () {
     incorrectCallback = {
@@ -46,10 +46,10 @@ t.step(function () {
             assert_unreached("Invalid callback invoked: ");
         })
     };
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.addStorageStateChangeListener(incorrectCallback);
-        }, exceptionName + " should be thrown - given incorrect error callback.");
+        }, "given incorrect error callback");
     t.done();
 });
 
index 756c23a7fb3fb7409e6dc930d90cb439a69c1ff6..8c758f3bcc2f5030cb7c0f6426e2ee584ac7f917 100644 (file)
@@ -38,7 +38,7 @@ Authors:
 
 //  Check argument onError validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", getStorageIncorrect, getStorageSuccess,
+    getStorageIncorrect, getStorageSuccess,
     listStoragesSuccess, listStoragesError;
 
 t.step(function () {
@@ -54,10 +54,10 @@ t.step(function () {
         assert_unreached("listStorages() error callback invoked: name: " + error.name + ", msg: " + error.message);
     });
     listStoragesSuccess = t.step_func(function (storages) {
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 tizen.filesystem.getStorage(storages[0].label, getStorageSuccess, getStorageIncorrect);
-            }, exceptionName + " should be thrown - given incorrect error callback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 42799e3fca49e2caaa3aa2555657a0fb188fcced..62f344dccac1a1f16707bde92a2e5f7ebe5ed04c 100644 (file)
@@ -38,7 +38,7 @@ Authors:
 
 //  Check argument onSuccess validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", getStorageIncorrect, listStoragesError,
+    getStorageIncorrect, listStoragesError,
     listStoragesSuccess;
 
 t.step(function () {
@@ -49,10 +49,10 @@ t.step(function () {
     };
 
     listStoragesSuccess = t.step_func(function (storages) {
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 tizen.filesystem.getStorage(storages[0].label, getStorageIncorrect);
-            }, exceptionName + " should be thrown - given incorrect error callback.");
+            }, "given incorrect error callback");
         t.done();
     });
     listStoragesError = t.step_func(function (error) {
index 5b1fda80a45e9b22d326977a9c7d86f49467d7b0..0e92d5332e225adea09ae2647437f42f75ea7107 100644 (file)
@@ -38,8 +38,7 @@ Authors:
 
 //  Check argument onError validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", listStoragesIncorrect,
-    listStoragesSuccess;
+    listStoragesIncorrect, listStoragesSuccess;
 
 t.step(function () {
 
@@ -52,10 +51,10 @@ t.step(function () {
             assert_unreached("Invalid callback invoked: ");
         })
     };
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.listStorages(listStoragesSuccess, listStoragesIncorrect);
-        }, exceptionName + "should be thrown - given incorrect error callback.");
+        }, "given incorrect errorCallback");
     t.done();
 });
 
index f3fc62cfab397cbf6d632f93aa14ec3f21aefcc9..fd5359152214f869ce1ae3071c4b845e9075f1b2 100644 (file)
@@ -39,7 +39,7 @@ Authors:
 
 //  Check argument onSuccess validation
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", listStoragesIncorrect;
+    listStoragesIncorrect;
 
 t.step(function () {
 
@@ -48,10 +48,10 @@ t.step(function () {
             assert_unreached("Invalid callback invoked: ");
         })
     };
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.listStorages(listStoragesIncorrect);
-        }, exceptionName + "should be thrown - given incorrect error callback.");
+        }, "given incorrect error callback");
     t.done();
 });
 
index 3804f70de959e0709aa31ba81c7d02f22b021bf1..ecadf06585754fef6a41c445b470a891e30bb36d 100644 (file)
@@ -41,17 +41,17 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/filesystem.html
 //==== TEST_CRITERIA MC
 var t = async_test(document.title),
-    invalid_type_params = [123, "abc", true, {}], getStorageSuccess, i;
+    invalidTypeParams = [123, "abc", true, {}], getStorageSuccess, i;
 t.step(function () {
     getStorageSuccess = t.step_func(function (storages) {
         assert_unreached("Unexpected getStorageSuccess");
     });
 
-    for (i = 0; i < invalid_type_params.length; i++) {
+    for (i = 0; i < invalidTypeParams.length; i++) {
         assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
             tizen.filesystem.listStorages(
                 getStorageSuccess,
-                invalid_type_params[i]
+                invalidTypeParams[i]
             );
         });
     }
index 0c01810c492b05396ceff773ab82844cd6fbcecf..fe98abbb49cc3addd9c970c8315c7261a81c0c14 100644 (file)
@@ -37,8 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", resolveError, resolveSuccess,
-    conversionTable;
+    resolveError, resolveSuccess, conversionTable;
 
 t.step(function () {
     conversionTable = getTypeConversionExceptions("functionObject", true);
@@ -49,10 +48,10 @@ t.step(function () {
             assert_unreached("Invalid callback invoked: ");
         })
     };
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.resolve("images", resolveSuccess, resolveError, "rw");
-        }, exceptionName + "should be thrown - given incorrect error callback.");
+        }, "given incorrect errorCallback");
     t.done();
 });
 
index ba4d843d3cd68dbf2f6c9d3ec2b99580471e6d89..7cda4b17586c464f10c10c77ceada167fe2f95b8 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    exceptionName = "TypeMismatchError", resolveSuccess, resolveError;
+    resolveSuccess, resolveError;
 
 t.step(function () {
 
@@ -51,10 +51,10 @@ t.step(function () {
         })
     };
 
-    assert_throws({name: exceptionName},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             tizen.filesystem.resolve("documents", resolveSuccess, resolveError);
-        }, exceptionName + "should be thrown - given incorrect error callback.");
+        }, "given incorrect error callback");
     t.done();
 });
 
index a763a0eaedf5d08bb219937bc8cf8cf9a6e18e90..4ef77f4999da16366e708da3ed9c1ab814670478 100644 (file)
@@ -64,7 +64,7 @@ t.step(function () {
         assert_true("fileSize" in dir, "fileSize don't exist in object");
         assert_type(dir.fileSize, "undefined", "fileSize should be undefined");
         assert_true("length" in dir, "length don't exist in object");
-        assert_type(dir.length, "number", "type of length should be number");
+        assert_type(dir.length, "long", "type of length should be number");
         assert_true(dir.length >= 0, "value of length should be >= 0");
         t.done();
     });
index 258a9503fb98ed4d8c8928488b24ef1f19420ed9..1e6c088c5c4022a5191e2070a3c1c766ee5c8d76 100644 (file)
@@ -42,7 +42,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), resolveSuccess, resolveError,
-    copySuccess, copyError, exceptionName = "TypeMismatchError", fsTestFileName;
+    copySuccess, copyError, fsTestFileName;
 
 t.step(function () {
     fsTestFileName =  getFileName("filesystem.txt");
@@ -58,10 +58,10 @@ t.step(function () {
     });
 
     resolveSuccess = t.step_func(function (dir) {
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.copyTo(fsTestFileName, "images", true, copySuccess, copyError);
-            }, exceptionName + " should be thrown - given incorrect errorCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 52e0d677d0943e68f2a79c3fdc0fa6bb4822268c..40367a06e4576fe088795d89dbc0b2a5ad4df092 100644 (file)
@@ -40,7 +40,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, copySuccess, exceptionName = "TypeMismatchError", fsTestFile, fsTestFileName;
+    resolveSuccess, resolveError, copySuccess, fsTestFile, fsTestFileName;
 
 t.step(function (){
     fsTestFileName =  getFileName("filesystem.txt");
@@ -53,10 +53,10 @@ t.step(function (){
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.copyTo(fsTestFile.fullPath, "images", true, copySuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index e27937b8c1726e75863aa3b93f353a208857a805..44e8da31916e71a15e583a0e4a013afd5e0b4133 100644 (file)
@@ -42,8 +42,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, deleteDirectorySuccess, deleteDirectoryError, fsTestDirName, fsTestDir,
-    exceptionName = "TypeMismatchError";
+    resolveSuccess, resolveError, deleteDirectorySuccess, deleteDirectoryError, fsTestDirName, fsTestDir;
 
 t.step(function () {
     fsTestDirName =  getDirName("filesystem");
@@ -60,10 +59,10 @@ t.step(function () {
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestDir = dir.createDirectory(fsTestDirName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.deleteDirectory(fsTestDir.fullPath, deleteDirectorySuccess, deleteDirectoryError);
-            }, exceptionName + " should be thrown - given incorrect deleteDirectorySuccess.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 808b3a4d40342931686a21d88192245d8914a1a1..8206afb629a8ee93abc3d76928cd75c101fdf209 100644 (file)
@@ -43,7 +43,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, deleteSuccess, exceptionName = "TypeMismatchError", fsTestDirName, fsTestDir;
+    resolveSuccess, resolveError, deleteSuccess, fsTestDirName, fsTestDir;
 
 t.step(function (){
     fsTestDirName =  getDirName("filesystem");
@@ -56,10 +56,10 @@ t.step(function (){
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestDir = dir.createDirectory(fsTestDirName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.deleteDirectory(fsTestDir.fullPath, false, deleteSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index 1401ffb8119eaa59f701aede2983a55e818efa94..6e8af7cd9ff42968279eb553ceee2d2f72b549fa 100644 (file)
@@ -37,8 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), fsTestFileName, fsTestFile,
-    resolveSuccess, resolveError, deleteFileSuccess, exceptionName = "TypeMismatchError",
-    deleteFileError;
+    resolveSuccess, resolveError, deleteFileSuccess, deleteFileError;
 
 t.step(function () {
     fsTestFileName = getFileName("filesystem.txt");
@@ -53,10 +52,10 @@ t.step(function () {
     });
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createDirectory(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.deleteFile(fsTestFile.fullPath, deleteFileSuccess, deleteFileError);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index f7259e8ceeab8e8f43ad31e1a0b61c37d174dce3..dc4cc2d2a085e88ab7a6b8b186b02d72bb1756da 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), fsTestFileName, fsTestFile,
-    resolveSuccess, resolveError, deleteFileSuccess, exceptionName = "TypeMismatchError";
+    resolveSuccess, resolveError, deleteFileSuccess;
 
 t.step(function () {
     fsTestFileName = getFileName("filesystem.txt");
@@ -50,10 +50,10 @@ t.step(function () {
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.deleteFile(fsTestFile.fullPath, deleteFileSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index 4c1ec0d5c713facb62923fc90d0a9e5cfa42c661..31b4f0878937f4a50879c8075d76d19d94649b33 100644 (file)
@@ -22,7 +22,7 @@ Authors:
 <html>
 <head>
 <title>File_listFiles</title>
-<script type="text/javascript" src="support/unitcommon.js"></script> 
+<script type="text/javascript" src="support/unitcommon.js"></script>
 <script type="text/javascript" src="support/filesystem_common.js"></script>
 </head>
 <body>
@@ -39,6 +39,7 @@ var t = async_test(document.title),
     resolveSuccess, resolveError, listFilesSuccess, retVal=null;
 t.step(function () {
     listFilesSuccess = t.step_func(function (files) {
+        assert_type(files, "array", "files should be array");
         assert_equals(retVal, undefined, "incorrect returned value");
         t.done();
     });
index 01705187610c8e05c5c01376346df7760f81344a..8e7eecdcc87ef0a798dc9cd7769970a8903bac97 100644 (file)
@@ -37,8 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), fsTestFileName, fsTestFile,
-    resolveSuccess, resolveError, listFilesSuccess, exceptionName = "TypeMismatchError",
-    listFilesError;
+    resolveSuccess, resolveError, listFilesSuccess, listFilesError;
 t.step(function () {
     fsTestFileName = getFileName("filesystem.txt");
 
@@ -52,10 +51,10 @@ t.step(function () {
     });
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 fsTestFile.listFiles(listFilesSuccess, listFilesError);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 01a1da201f9a5ca45958d44627f186816224b625..e52cf034d20b8dbd14b2a04779a5f089b5f8902e 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, listFilesSuccess, exceptionName = "TypeMismatchError";
+    resolveSuccess, resolveError, listFilesSuccess;
 
 t.step(function () {
     listFilesSuccess = {
@@ -47,11 +47,10 @@ t.step(function () {
     };
 
     resolveSuccess = t.step_func(function (dir) {
-        assert_throws({
-                name: exceptionName
-            }, function () {
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
+            function () {
                 dir.listFiles(listFilesSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index 29721c4229a89d3aa115ca04b958e76bccf0c1fd..a31a80d7b19155a21e93430b3e46c1d1ded66028 100644 (file)
@@ -37,8 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), fsTestFileName, fsTestFile,
-    resolveSuccess, resolveError, moveToSuccess, exceptionName = "TypeMismatchError",
-    moveToError;
+    resolveSuccess, resolveError, moveToSuccess, moveToError;
 
 t.step(function () {
     fsTestFileName = getFileName("filesystem.txt");
@@ -54,10 +53,10 @@ t.step(function () {
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.moveTo(fsTestFile.fullPath, "images", true, moveToSuccess, moveToError);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 4ae4c3103e2f5707bfde404b69024db147c6925a..8cbf4cbb6b98c4658e83b4b0e4e23ea36238eca3 100644 (file)
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title), resolveSuccess, resolveError,
-    moveToSuccess, exceptionName = "TypeMismatchError", fsTestFileName, fsTestFile;
+    moveToSuccess, fsTestFileName, fsTestFile;
 
 t.step(function () {
     fsTestFileName = getFileName("filesystem.txt");
@@ -51,10 +51,10 @@ t.step(function () {
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.moveTo(fsTestFile.fullPath, "images", true, moveToSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index 55b21bf63153d361f47a63529325b91adcbbec1f..cb90cdcb38bd30192d0c89566174dfe60791fae2 100644 (file)
@@ -36,8 +36,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, openStreamSuccess, exceptionName = "TypeMismatchError",
-    openStreamError;
+    resolveSuccess, resolveError, openStreamSuccess, openStreamError;
 t.step(function () {
     openStreamError = {
         onerror: t.step_func(function (error) {
@@ -51,10 +50,10 @@ t.step(function () {
     });
 
     resolveSuccess = t.step_func(function (dir) {
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.openStream("r", openStreamSuccess, openStreamError);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
 
index 3e21e3543ab103e5c0b876db0f578d5dd283467d..7363cb40e688c634d8160fdcb799b45c1241c7ac 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, openStreamSuccess, exceptionName = "TypeMismatchError", fsTestFileName, fsTestFile;
+    resolveSuccess, resolveError, openStreamSuccess, fsTestFileName, fsTestFile;
 t.step(function (){
     fsTestFileName = getFileName("filesystem.txt");
 
@@ -49,10 +49,10 @@ t.step(function (){
 
     resolveSuccess = t.step_func(function (dir) {
         fsTestFile = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 fsTestFile.openStream("r", openStreamSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
 
index 49850255d2a36e1a76793c3f45fb84c8fcdc5644..7b9b26b5474cee1206e48a608fd76820750e7dc4 100644 (file)
@@ -37,8 +37,7 @@ Authors:
 //==== TEST_CRITERIA MTCB
 
 var t = async_test(document.title),
-    resolveSuccess, resolveError, readAsTextSuccess, readAsTextError,
-    exceptionName = "TypeMismatchError";
+    resolveSuccess, resolveError, readAsTextSuccess, readAsTextError;
 
 t.step(function () {
     readAsTextError = {
@@ -51,10 +50,10 @@ t.step(function () {
     });
 
     resolveSuccess = t.step_func(function (dir) {
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 dir.readAsText(readAsTextSuccess, readAsTextError);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect errorCallback");
         t.done();
     });
     resolveError = t.step_func(function (error) {
index fd5b7e9146e77a08b9730fcd6c20f7870c39e277..de99a69a128a0a56a1fd24f276346e46622f6a0c 100644 (file)
@@ -39,7 +39,6 @@ Authors:
 
 var t = async_test(document.title),
     resolveSuccess, resolveError, readAsTextSuccess,
-    exceptionName = "TypeMismatchError",
     fsTestFileName = getFileName("goodFile.txt"), file;
 
 t.step(function (){
@@ -50,10 +49,10 @@ t.step(function (){
     };
     resolveSuccess = t.step_func(function (dir) {
         file = dir.createFile(fsTestFileName);
-        assert_throws({name: exceptionName},
+        assert_throws(TYPE_MISMATCH_EXCEPTION,
             function () {
                 file.readAsText(readAsTextSuccess);
-            }, exceptionName + " should be thrown - given incorrect successCallback.");
+            }, "given incorrect successCallback");
         t.done();
     });
     resolveError = t.step_func(function (error) {
index fe8b6108ce3349f807529990ab13af210dc44eec..1b9da45444710f842afabf54b08ac8472241c9db 100644 (file)
@@ -40,7 +40,7 @@ var t = async_test(document.title),
     readAsTextSuccess, readAsTextError, i;
 
 t.step(function (){
-    readAsTextSuccess = t.step_func(function (files) {
+    readAsTextSuccess = t.step_func(function (text) {
         t.done();
     });
     readAsTextError = t.step_func(function (error) {
index 7ee47ae630944522f2a8a2e0d968690c6849c871..7b3a7abb06253c83441dbde4ce404842ad2683ca 100644 (file)
@@ -46,7 +46,7 @@ t.step(function () {
         assert_not_equals(error.message, "", "incorrect error message");
         t.done();
     });
-    readAsTextSuccess = t.step_func(function (files) {
+    readAsTextSuccess = t.step_func(function (text) {
         assert_unreached("readAsTextSuccess: readAsTextError should be invoked");
     });