OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <script src="resources/shared.js"></script> | 4 <script src="resources/shared.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <input type="file" id="fileInput" multiple></input> | 7 <input type="file" id="fileInput" multiple></input> |
8 <script> | 8 <script> |
9 | 9 |
10 description("Test structured clone permutations in IndexedDB. File/FileList test
s require DumpRenderTree."); | 10 description("Test structured clone permutations in IndexedDB. File/FileList test
s require DumpRenderTree."); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 shouldBeEqualToString("text2", text1); | 350 shouldBeEqualToString("text2", text1); |
351 callback(); | 351 callback(); |
352 }); | 352 }); |
353 }); | 353 }); |
354 } | 354 } |
355 | 355 |
356 function testBlob(callback) | 356 function testBlob(callback) |
357 { | 357 { |
358 debug("Testing Blob"); | 358 debug("Testing Blob"); |
359 | 359 |
360 // FIXME: Blob, File, and FileList support is incomplete. | |
361 // http://crbug.com/108012 | |
362 debug("Skipping test"); | |
363 callback(); | |
364 return; | |
365 | |
366 shouldBeTrue("FileReader != null"); | 360 shouldBeTrue("FileReader != null"); |
367 evalAndLog("test_content = 'This is a test. This is only a test.'"); | 361 evalAndLog("test_content = 'This is a test. This is only a test.'"); |
368 evalAndLog("test_data = new Blob([test_content])"); | 362 evalAndLog("test_data = new Blob([test_content])"); |
369 testValue(test_data, function(result) { | 363 testValue(test_data, function(result) { |
370 self.result = result; | 364 self.result = result; |
371 shouldBeTrue("test_data !== result"); | 365 shouldBeTrue("test_data !== result"); |
372 shouldBeEqualToString("Object.prototype.toString.call(result)", "[object
Blob]"); | 366 shouldBeEqualToString("Object.prototype.toString.call(result)", "[object
Blob]"); |
373 shouldBe("result.size", "test_data.size"); | 367 shouldBe("result.size", "test_data.size"); |
374 shouldBe("result.type", "test_data.type"); | 368 shouldBe("result.type", "test_data.type"); |
375 checkBlobContents(result, test_content, callback); | 369 checkBlobContents(result, test_content, callback); |
(...skipping 16 matching lines...) Expand all Loading... |
392 shouldBe("String(file1.lastModifiedDate)", "String(file2.lastModifiedDate)")
; | 386 shouldBe("String(file1.lastModifiedDate)", "String(file2.lastModifiedDate)")
; |
393 if (callback) { | 387 if (callback) { |
394 compareBlobs(file1, file2, callback); | 388 compareBlobs(file1, file2, callback); |
395 } | 389 } |
396 } | 390 } |
397 | 391 |
398 function testFile(callback) | 392 function testFile(callback) |
399 { | 393 { |
400 debug("Testing File"); | 394 debug("Testing File"); |
401 | 395 |
402 // FIXME: Blob, File, and FileList support is incomplete. | |
403 // http://crbug.com/108012 | |
404 debug("Skipping test"); | |
405 callback(); | |
406 return; | |
407 | |
408 evalAndLog("test_content = fileInput.files[0]"); | 396 evalAndLog("test_content = fileInput.files[0]"); |
409 | 397 |
410 self.test_data = test_content; | 398 self.test_data = test_content; |
411 testValue(test_data, function(result) { | 399 testValue(test_data, function(result) { |
412 self.result = result; | 400 self.result = result; |
413 compareFiles(result, test_data, callback); | 401 compareFiles(result, test_data, callback); |
414 }); | 402 }); |
415 } | 403 } |
416 | 404 |
417 | 405 |
418 function testFileList(callback) | 406 function testFileList(callback) |
419 { | 407 { |
420 debug("Testing FileList"); | 408 debug("Testing FileList"); |
421 | 409 |
422 // FIXME: Blob, File, and FileList support is incomplete. | |
423 // http://crbug.com/108012 | |
424 debug("Skipping test"); | |
425 callback(); | |
426 return; | |
427 | |
428 evalAndLog("test_content = fileInput.files"); | 410 evalAndLog("test_content = fileInput.files"); |
429 | 411 |
430 self.test_data = test_content; | 412 self.test_data = test_content; |
431 testValue(test_data, function(result) { | 413 testValue(test_data, function(result) { |
432 self.result = result; | 414 self.result = result; |
433 shouldBeTrue("test_data !== result"); | 415 shouldBeTrue("test_data !== result"); |
434 shouldBeEqualToString("Object.prototype.toString.call(result)", "[object
FileList]"); | 416 shouldBeEqualToString("Object.prototype.toString.call(result)", "[object
FileList]"); |
435 shouldBe("result.length", "test_data.length"); | 417 shouldBe("result.length", "test_data.length"); |
436 i = 0; | 418 i = 0; |
437 function doNext() { | 419 function doNext() { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 debug(""); | 527 debug(""); |
546 debug("Other host object types:"); | 528 debug("Other host object types:"); |
547 evalAndExpectException("store.put(self, 'key')", "DOMException.DATA_CLONE_ER
R"); | 529 evalAndExpectException("store.put(self, 'key')", "DOMException.DATA_CLONE_ER
R"); |
548 evalAndExpectException("store.put(document, 'key')", "DOMException.DATA_CLON
E_ERR"); | 530 evalAndExpectException("store.put(document, 'key')", "DOMException.DATA_CLON
E_ERR"); |
549 evalAndExpectException("store.put(document.body, 'key')", "DOMException.DATA
_CLONE_ERR"); | 531 evalAndExpectException("store.put(document.body, 'key')", "DOMException.DATA
_CLONE_ERR"); |
550 } | 532 } |
551 | 533 |
552 </script> | 534 </script> |
553 </body> | 535 </body> |
554 </html> | 536 </html> |
OLD | NEW |