| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <meta charset=utf-8> | |
| 3 <title>IDBFactory.cmp() - comparison of binary keys</title> | |
| 4 <link rel="author" title="Mozilla" href="https://www.mozilla.org"> | |
| 5 <link rel="help" href="http://w3c.github.io/IndexedDB/#key-construct"> | |
| 6 <script src=/resources/testharness.js></script> | |
| 7 <script src=/resources/testharnessreport.js></script> | |
| 8 | |
| 9 <script> | |
| 10 test(function() { | |
| 11 assert_equals(indexedDB.cmp(new Int8Array([-1]), new Uint8Array([0])), 1, | |
| 12 "255(-1) shall be larger than 0"); | |
| 13 }, "Compare in unsigned octet values (in the range [0, 255])"); | |
| 14 | |
| 15 test(function() { | |
| 16 assert_equals(indexedDB.cmp( | |
| 17 new Uint8Array([255, 254, 253]), | |
| 18 new Uint8Array([255, 253, 254])), | |
| 19 1, | |
| 20 "[255, 254, 253] shall be larger than [255, 253, 254]"); | |
| 21 }, "Compare values in then same length"); | |
| 22 | |
| 23 test(function() { | |
| 24 assert_equals(indexedDB.cmp( | |
| 25 new Uint8Array([255, 254]), | |
| 26 new Uint8Array([255, 253, 254])), | |
| 27 1, | |
| 28 "[255, 254] shall be larger than [255, 253, 254]"); | |
| 29 }, "Compare values in different lengths"); | |
| 30 | |
| 31 test(function() { | |
| 32 assert_equals(indexedDB.cmp( | |
| 33 new Uint8Array([255, 253, 254]), | |
| 34 new Uint8Array([255, 253])), | |
| 35 1, | |
| 36 "[255, 253, 254] shall be larger than [255, 253]"); | |
| 37 }, "Compare when the values in the range of their minimal length are the same"
); | |
| 38 </script> | |
| 39 | |
| 40 <div id=log></div> | |
| OLD | NEW |