[common][fileapi][DPTTIZEN-3016 modify 4 cases for spec changes] 20/178820/1
authorwei zhang <wei625.zhang@samsung.com>
Mon, 14 May 2018 14:47:36 +0000 (22:47 +0800)
committerwei zhang <wei625.zhang@samsung.com>
Mon, 14 May 2018 14:47:36 +0000 (22:47 +0800)
Change-Id: Iafd1b197af8351a2f8ea634a01e382a6c93f8486

common/tct-fileapi-w3c-tests/fileapi/w3c/Blob-constructor.html

index ec8332e890385fee9b6cbe803c39dd2ced406097..4e26166aa6e3d675d8774fd544b3b32f685c9098 100755 (executable)
@@ -46,11 +46,15 @@ test(function() {
 }, "Passing non-objects, Dates and RegExps for blobParts should throw a TypeError.");
 
 test_blob(function() {
-  return new Blob({ 0: "PASS", length: 1 });
+  return new Blob({
+    [Symbol.iterator]: Array.prototype[Symbol.iterator],
+    0: "PASS",
+    length: 1
+  });
 }, {
   expected: "PASS",
   type: "",
-  desc: "A plain object with a length property should be treated as a sequence for the blobParts argument."
+  desc: "A plain object with @@iterator and a length property should be treated as a sequence for the blobParts argument."
 });
 test_blob(function() {
   return new Blob(new String("xyz"));
@@ -71,6 +75,7 @@ var test_error = { name: "test" };
 
 test(function() {
   var obj = {
+    [Symbol.iterator]: Array.prototype[Symbol.iterator],
     get length() { throw test_error; }
   };
   assert_throws(test_error, function() {
@@ -81,6 +86,7 @@ test(function() {
 test(function() {
   assert_throws(test_error, function() {
     var obj = {
+      [Symbol.iterator]: Array.prototype[Symbol.iterator],
       length: {
         valueOf: null,
         toString: function() { throw test_error; }
@@ -90,6 +96,7 @@ test(function() {
   });
   assert_throws(test_error, function() {
     var obj = {
+      [Symbol.iterator]: Array.prototype[Symbol.iterator],
       length: { valueOf: function() { throw test_error; } }
     };
     new Blob(obj);
@@ -99,6 +106,10 @@ test(function() {
 test(function() {
   var received = [];
   var obj = {
+    get [Symbol.iterator]() {
+      received.push("Symbol.iterator");
+      return Array.prototype[Symbol.iterator];
+    },
     get length() {
       received.push("length getter");
       return {
@@ -130,10 +141,13 @@ test(function() {
     new Blob(obj);
   });
   assert_array_equals(received, [
+    "Symbol.iterator",
     "length getter",
     "length valueOf",
     "0 getter",
     "0 toString",
+    "length getter",
+    "length valueOf",
     "1 getter"
   ]);
 }, "Getters and value conversions should happen in order until an exception is thrown.");