| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | |
| 5 <script src="resources/microdata-common.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <p>This test that the itemProp should be correct for an element that has itemPro
p attribute.</p> | |
| 9 <div id="console"></div> | |
| 10 <script> | |
| 11 var element = createElement('div', {itemprop: 'foo bar FOO FOo'}); | |
| 12 | |
| 13 shouldBeTrue("element.itemProp.length == 4"); | |
| 14 shouldBeTrue("element.itemProp.toString() == 'foo bar FOO FOo'"); | |
| 15 shouldBeTrue("element.itemProp.item(0) == 'foo'"); | |
| 16 shouldBeTrue("element.itemProp.item(1) == 'bar'"); | |
| 17 shouldBeTrue("element.itemProp[0] == 'foo'"); | |
| 18 shouldBeTrue("element.itemProp[1] == 'bar'"); | |
| 19 shouldBeTrue("element.itemProp.contains('bar')"); | |
| 20 | |
| 21 debug("<br>itemProp should return case-sensitive strings."); | |
| 22 shouldBeTrue("element.itemProp.item(2) == 'FOO'"); | |
| 23 shouldBeTrue("element.itemProp[2] == 'FOO'"); | |
| 24 shouldBeTrue("element.itemProp.item(3) == 'FOo'"); | |
| 25 shouldBeTrue("element.itemProp[2] == 'FOo'"); | |
| 26 | |
| 27 debug("<br>itemProp should not contain an undefined token."); | |
| 28 shouldBeFalse("element.itemProp.contains('test')"); | |
| 29 | |
| 30 debug("<br>itemProp.length should be 0 if element doesn't have any tokens."); | |
| 31 var element1 = createElement('div', {itemprop: ''}); | |
| 32 shouldBeTrue("element1.itemProp.length == 0"); | |
| 33 | |
| 34 </script> | |
| 35 <script src="../../js/resources/js-test-post.js"></script> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |