Changeset 122262 in webkit
- Timestamp:
- Jul 10, 2012 2:21:34 PM (12 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122256 r122262 1 2012-07-10 Joshua Bell <jsbell@chromium.org> 2 3 [Chromium] IndexedDB: Need test of Typed Arrays 4 https://bugs.webkit.org/show_bug.cgi?id=81979 5 6 Reviewed by Tony Chang. 7 8 Verify storage of Typed Arrays (Uint8Array and friends). Checks that 9 these types are stored and read back with types and data intact. Also 10 add an index to the object store, so that key paths are evaluated 11 against each type on every write operation. 12 13 * storage/indexeddb/structured-clone-expected.txt: 14 * storage/indexeddb/structured-clone.html: 15 1 16 2012-07-10 Adam Barth <abarth@webkit.org> 2 17 -
trunk/LayoutTests/storage/indexeddb/structured-clone-expected.txt
r116337 r122262 13 13 PASS db.version is "" 14 14 db.setVersion('1') 15 db.createObjectStore('storeName') 15 store = db.createObjectStore('storeName') 16 This index is not used, but evaluating key path on each put() call will exercise (de)serialization: 17 store.createIndex('indexName', 'dummyKeyPath') 16 18 17 19 Running tests... … … 581 583 PASS test_data["bar"] is result["bar"] 582 584 PASS test_data[""] is result[""] 585 586 Testing TypedArray 587 value = new Uint8Array([]) 588 transaction = db.transaction('storeName', 'readwrite') 589 store = transaction.objectStore('storeName') 590 store.put(value, 'key') 591 store.get('key') 592 PASS test_data !== result is true 593 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 594 PASS test_data.length === result.length is true 595 596 value = new Uint8Array([0, 1, 254, 255]) 597 transaction = db.transaction('storeName', 'readwrite') 598 store = transaction.objectStore('storeName') 599 store.put(value, 'key') 600 store.get('key') 601 PASS test_data !== result is true 602 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 603 PASS test_data.length === result.length is true 604 PASS is(test_data[0], result[0]) is true 605 PASS is(test_data[1], result[1]) is true 606 PASS is(test_data[2], result[2]) is true 607 PASS is(test_data[3], result[3]) is true 608 609 value = new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF]) 610 transaction = db.transaction('storeName', 'readwrite') 611 store = transaction.objectStore('storeName') 612 store.put(value, 'key') 613 store.get('key') 614 PASS test_data !== result is true 615 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 616 PASS test_data.length === result.length is true 617 PASS is(test_data[0], result[0]) is true 618 PASS is(test_data[1], result[1]) is true 619 PASS is(test_data[2], result[2]) is true 620 PASS is(test_data[3], result[3]) is true 621 622 value = new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF]) 623 transaction = db.transaction('storeName', 'readwrite') 624 store = transaction.objectStore('storeName') 625 store.put(value, 'key') 626 store.get('key') 627 PASS test_data !== result is true 628 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 629 PASS test_data.length === result.length is true 630 PASS is(test_data[0], result[0]) is true 631 PASS is(test_data[1], result[1]) is true 632 PASS is(test_data[2], result[2]) is true 633 PASS is(test_data[3], result[3]) is true 634 635 value = new Int8Array([0, 1, 254, 255]) 636 transaction = db.transaction('storeName', 'readwrite') 637 store = transaction.objectStore('storeName') 638 store.put(value, 'key') 639 store.get('key') 640 PASS test_data !== result is true 641 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 642 PASS test_data.length === result.length is true 643 PASS is(test_data[0], result[0]) is true 644 PASS is(test_data[1], result[1]) is true 645 PASS is(test_data[2], result[2]) is true 646 PASS is(test_data[3], result[3]) is true 647 648 value = new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF]) 649 transaction = db.transaction('storeName', 'readwrite') 650 store = transaction.objectStore('storeName') 651 store.put(value, 'key') 652 store.get('key') 653 PASS test_data !== result is true 654 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 655 PASS test_data.length === result.length is true 656 PASS is(test_data[0], result[0]) is true 657 PASS is(test_data[1], result[1]) is true 658 PASS is(test_data[2], result[2]) is true 659 PASS is(test_data[3], result[3]) is true 660 661 value = new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF]) 662 transaction = db.transaction('storeName', 'readwrite') 663 store = transaction.objectStore('storeName') 664 store.put(value, 'key') 665 store.get('key') 666 PASS test_data !== result is true 667 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 668 PASS test_data.length === result.length is true 669 PASS is(test_data[0], result[0]) is true 670 PASS is(test_data[1], result[1]) is true 671 PASS is(test_data[2], result[2]) is true 672 PASS is(test_data[3], result[3]) is true 673 674 value = new Uint8ClampedArray([0, 1, 254, 255]) 675 transaction = db.transaction('storeName', 'readwrite') 676 store = transaction.objectStore('storeName') 677 store.put(value, 'key') 678 store.get('key') 679 PASS test_data !== result is true 680 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 681 PASS test_data.length === result.length is true 682 PASS is(test_data[0], result[0]) is true 683 PASS is(test_data[1], result[1]) is true 684 PASS is(test_data[2], result[2]) is true 685 PASS is(test_data[3], result[3]) is true 686 687 value = new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN]) 688 transaction = db.transaction('storeName', 'readwrite') 689 store = transaction.objectStore('storeName') 690 store.put(value, 'key') 691 store.get('key') 692 PASS test_data !== result is true 693 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 694 PASS test_data.length === result.length is true 695 PASS is(test_data[0], result[0]) is true 696 PASS is(test_data[1], result[1]) is true 697 PASS is(test_data[2], result[2]) is true 698 PASS is(test_data[3], result[3]) is true 699 PASS is(test_data[4], result[4]) is true 700 PASS is(test_data[5], result[5]) is true 701 PASS is(test_data[6], result[6]) is true 702 PASS is(test_data[7], result[7]) is true 703 PASS is(test_data[8], result[8]) is true 704 PASS is(test_data[9], result[9]) is true 705 706 value = new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN]) 707 transaction = db.transaction('storeName', 'readwrite') 708 store = transaction.objectStore('storeName') 709 store.put(value, 'key') 710 store.get('key') 711 PASS test_data !== result is true 712 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 713 PASS test_data.length === result.length is true 714 PASS is(test_data[0], result[0]) is true 715 PASS is(test_data[1], result[1]) is true 716 PASS is(test_data[2], result[2]) is true 717 PASS is(test_data[3], result[3]) is true 718 PASS is(test_data[4], result[4]) is true 719 PASS is(test_data[5], result[5]) is true 720 PASS is(test_data[6], result[6]) is true 721 PASS is(test_data[7], result[7]) is true 722 583 723 584 724 -
trunk/LayoutTests/storage/indexeddb/structured-clone.html
r121492 r122262 41 41 request.onerror = unexpectedErrorCallback; 42 42 request.onsuccess = function(e) { 43 evalAndLog("db.createObjectStore('storeName')"); 43 evalAndLog("store = db.createObjectStore('storeName')"); 44 debug("This index is not used, but evaluating key path on each put() call will exercise (de)serialization:"); 45 evalAndLog("store.createIndex('indexName', 'dummyKeyPath')"); 44 46 var trans = request.result; 45 47 trans.onerror = unexpectedErrorCallback; … … 71 73 testFileList, 72 74 testArray, 73 testObject 75 testObject, 76 testTypedArray 74 77 ]; 75 78 … … 506 509 } 507 510 511 function testTypedArray(callback) { 512 debug("Testing TypedArray"); 513 514 function testTypedArrayValue(string, callback) { 515 evalAndLog("value = " + string); 516 test_data = value; 517 testValue(test_data, function(result) { 518 self.result = result; 519 shouldBeTrue("test_data !== result"); 520 shouldBe("Object.prototype.toString.call(result)", "Object.prototype.toString.call(test_data)"); 521 shouldBeTrue("test_data.length === result.length"); 522 for (i = 0; i < test_data.length; ++i) { 523 shouldBeTrue("is(test_data[" + i + "], result[" + i + "])"); 524 } 525 debug(""); 526 callback(); 527 }); 528 } 529 530 forEachWithCallback(testTypedArrayValue, [ 531 "new Uint8Array([])", 532 "new Uint8Array([0, 1, 254, 255])", 533 "new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])", 534 "new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])", 535 "new Int8Array([0, 1, 254, 255])", 536 "new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])", 537 "new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])", 538 "new Uint8ClampedArray([0, 1, 254, 255])", 539 "new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])", 540 "new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])" 541 ], callback); 542 } 543 508 544 function testBadTypes() 509 545 {
Note: See TracChangeset
for help on using the changeset viewer.