Added: trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt (0 => 97168)
--- trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt 2011-10-11 19:22:14 UTC (rev 97168)
@@ -0,0 +1,398 @@
+Test IndexedDB key comparison using IDBFactory.cmp().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;
+PASS indexedDB == null is false
+IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;
+PASS IDBDatabaseException == null is false
+PASS typeof indexedDB.cmp === 'function' is true
+
+compare valid keys
+(Array keys are not yet implemented so many tests will fail)
+PASS indexedDB.cmp(-Infinity,-Number.MAX_VALUE) === -1 is true
+PASS indexedDB.cmp(-Number.MAX_VALUE,-Infinity) === 1 is true
+PASS indexedDB.cmp(-Infinity,-Infinity) === 0 is true
+PASS indexedDB.cmp(-Number.MAX_VALUE,-Number.MAX_VALUE) === 0 is true
+PASS indexedDB.cmp(-Number.MAX_VALUE,-1) === -1 is true
+PASS indexedDB.cmp(-1,-Number.MAX_VALUE) === 1 is true
+PASS indexedDB.cmp(-Number.MAX_VALUE,-Number.MAX_VALUE) === 0 is true
+PASS indexedDB.cmp(-1,-1) === 0 is true
+PASS indexedDB.cmp(-1,-Number.MIN_VALUE) === -1 is true
+PASS indexedDB.cmp(-Number.MIN_VALUE,-1) === 1 is true
+PASS indexedDB.cmp(-1,-1) === 0 is true
+PASS indexedDB.cmp(-Number.MIN_VALUE,-Number.MIN_VALUE) === 0 is true
+PASS indexedDB.cmp(-Number.MIN_VALUE,0) === -1 is true
+PASS indexedDB.cmp(0,-Number.MIN_VALUE) === 1 is true
+PASS indexedDB.cmp(-Number.MIN_VALUE,-Number.MIN_VALUE) === 0 is true
+PASS indexedDB.cmp(0,0) === 0 is true
+PASS indexedDB.cmp(0,Number.MIN_VALUE) === -1 is true
+PASS indexedDB.cmp(Number.MIN_VALUE,0) === 1 is true
+PASS indexedDB.cmp(0,0) === 0 is true
+PASS indexedDB.cmp(Number.MIN_VALUE,Number.MIN_VALUE) === 0 is true
+PASS indexedDB.cmp(Number.MIN_VALUE,1) === -1 is true
+PASS indexedDB.cmp(1,Number.MIN_VALUE) === 1 is true
+PASS indexedDB.cmp(Number.MIN_VALUE,Number.MIN_VALUE) === 0 is true
+PASS indexedDB.cmp(1,1) === 0 is true
+PASS indexedDB.cmp(1,Number.MAX_VALUE) === -1 is true
+PASS indexedDB.cmp(Number.MAX_VALUE,1) === 1 is true
+PASS indexedDB.cmp(1,1) === 0 is true
+PASS indexedDB.cmp(Number.MAX_VALUE,Number.MAX_VALUE) === 0 is true
+PASS indexedDB.cmp(Number.MAX_VALUE,Infinity) === -1 is true
+PASS indexedDB.cmp(Infinity,Number.MAX_VALUE) === 1 is true
+PASS indexedDB.cmp(Number.MAX_VALUE,Number.MAX_VALUE) === 0 is true
+PASS indexedDB.cmp(Infinity,Infinity) === 0 is true
+PASS indexedDB.cmp(Infinity,new Date(0)) === -1 is true
+PASS indexedDB.cmp(new Date(0),Infinity) === 1 is true
+PASS indexedDB.cmp(Infinity,Infinity) === 0 is true
+PASS indexedDB.cmp(new Date(0),new Date(0)) === 0 is true
+PASS indexedDB.cmp(new Date(0),new Date(1000)) === -1 is true
+PASS indexedDB.cmp(new Date(1000),new Date(0)) === 1 is true
+PASS indexedDB.cmp(new Date(0),new Date(0)) === 0 is true
+PASS indexedDB.cmp(new Date(1000),new Date(1000)) === 0 is true
+PASS indexedDB.cmp(new Date(1000),new Date(1317399931023)) === -1 is true
+PASS indexedDB.cmp(new Date(1317399931023),new Date(1000)) === 1 is true
+PASS indexedDB.cmp(new Date(1000),new Date(1000)) === 0 is true
+PASS indexedDB.cmp(new Date(1317399931023),new Date(1317399931023)) === 0 is true
+PASS indexedDB.cmp(new Date(1317399931023),'') === -1 is true
+PASS indexedDB.cmp('',new Date(1317399931023)) === 1 is true
+PASS indexedDB.cmp(new Date(1317399931023),new Date(1317399931023)) === 0 is true
+PASS indexedDB.cmp('','') === 0 is true
+PASS indexedDB.cmp('','\0') === -1 is true
+PASS indexedDB.cmp('\0','') === 1 is true
+PASS indexedDB.cmp('','') === 0 is true
+PASS indexedDB.cmp('\0','\0') === 0 is true
+PASS indexedDB.cmp('\0','a') === -1 is true
+PASS indexedDB.cmp('a','\0') === 1 is true
+PASS indexedDB.cmp('\0','\0') === 0 is true
+PASS indexedDB.cmp('a','a') === 0 is true
+PASS indexedDB.cmp('a','aa') === -1 is true
+PASS indexedDB.cmp('aa','a') === 1 is true
+PASS indexedDB.cmp('a','a') === 0 is true
+PASS indexedDB.cmp('aa','aa') === 0 is true
+PASS indexedDB.cmp('aa','b') === -1 is true
+PASS indexedDB.cmp('b','aa') === 1 is true
+PASS indexedDB.cmp('aa','aa') === 0 is true
+PASS indexedDB.cmp('b','b') === 0 is true
+PASS indexedDB.cmp('b','ba') === -1 is true
+PASS indexedDB.cmp('ba','b') === 1 is true
+PASS indexedDB.cmp('b','b') === 0 is true
+PASS indexedDB.cmp('ba','ba') === 0 is true
+PASS indexedDB.cmp('ba','¢') === -1 is true
+PASS indexedDB.cmp('¢','ba') === 1 is true
+PASS indexedDB.cmp('ba','ba') === 0 is true
+PASS indexedDB.cmp('¢','¢') === 0 is true
+PASS indexedDB.cmp('¢','水') === -1 is true
+PASS indexedDB.cmp('水','¢') === 1 is true
+PASS indexedDB.cmp('¢','¢') === 0 is true
+PASS indexedDB.cmp('水','水') === 0 is true
+PASS indexedDB.cmp('水','𝄞') === -1 is true
+PASS indexedDB.cmp('𝄞','水') === 1 is true
+PASS indexedDB.cmp('水','水') === 0 is true
+PASS indexedDB.cmp('𝄞','𝄞') === 0 is true
+PASS indexedDB.cmp('𝄞','�') === -1 is true
+PASS indexedDB.cmp('�','𝄞') === 1 is true
+PASS indexedDB.cmp('𝄞','𝄞') === 0 is true
+PASS indexedDB.cmp('�','�') === 0 is true
+FAIL indexedDB.cmp('�',[]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([],'�') === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+PASS indexedDB.cmp('�','�') === 0 is true
+FAIL indexedDB.cmp([],[]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([],[-Infinity]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-Infinity],[]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([],[]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-Infinity],[-Infinity]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-Infinity],[-1.7976931348623157e+308]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1.7976931348623157e+308],[-Infinity]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-Infinity],[-Infinity]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1.7976931348623157e+308],[-1.7976931348623157e+308]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1.7976931348623157e+308],[-1]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1],[-1.7976931348623157e+308]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1.7976931348623157e+308],[-1.7976931348623157e+308]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1],[-1]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1],[-5e-324]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-5e-324],[-1]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-1],[-1]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-5e-324],[-5e-324]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-5e-324],[0]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([0],[-5e-324]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([-5e-324],[-5e-324]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([0],[0]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([0],[5e-324]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([5e-324],[0]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([0],[0]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([5e-324],[5e-324]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([5e-324],[1]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1],[5e-324]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([5e-324],[5e-324]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1],[1]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1],[1.7976931348623157e+308]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1.7976931348623157e+308],[1]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1],[1]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1.7976931348623157e+308],[1.7976931348623157e+308]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1.7976931348623157e+308],[Infinity]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([Infinity],[1.7976931348623157e+308]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([1.7976931348623157e+308],[1.7976931348623157e+308]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([Infinity],[Infinity]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([Infinity],[new Date(0)]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(0)],[Infinity]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([Infinity],[Infinity]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(0)],[new Date(0)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(0)],[new Date(1000)]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1000)],[new Date(0)]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(0)],[new Date(0)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1000)],[new Date(1000)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1000)],[new Date(1317399931023)]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1317399931023)],[new Date(1000)]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1000)],[new Date(1000)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1317399931023)],[new Date(1317399931023)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1317399931023)],['']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([''],[new Date(1317399931023)]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([new Date(1317399931023)],[new Date(1317399931023)]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([''],['']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([''],['\0']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['\0'],['']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([''],['']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['\0'],['\0']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['\0'],['a']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['a'],['\0']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['\0'],['\0']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['a'],['a']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['a'],['aa']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['aa'],['a']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['a'],['a']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['aa'],['aa']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['aa'],['b']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['b'],['aa']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['aa'],['aa']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['b'],['b']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['b'],['ba']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['ba'],['b']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['b'],['b']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['ba'],['ba']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['ba'],['¢']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['¢'],['ba']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['ba'],['ba']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['¢'],['¢']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['¢'],['水']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['水'],['¢']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['¢'],['¢']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['水'],['水']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['水'],['𝄞']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['𝄞'],['水']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['水'],['水']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['𝄞'],['𝄞']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['𝄞'],['�']) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['�'],['𝄞']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['𝄞'],['𝄞']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['�'],['�']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['�'],[[]]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[]],['�']) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp(['�'],['�']) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[]],[[]]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[]],[[], []]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], []],[[]]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[]],[[]]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], []],[[], []]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], []],[[], [], []]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], [], []],[[], []]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], []],[[], []]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], [], []],[[], [], []]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], [], []],[[[]]]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[]]],[[], [], []]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[], [], []],[[], [], []]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[]]],[[[]]]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[]]],[[[[]]]]) === -1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[[]]]],[[[]]]) === 1 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[]]],[[[]]]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+FAIL indexedDB.cmp([[[[]]]],[[[[]]]]) === 0 should be true. Threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17
+
+compare invalid keys
+Expecting exception from indexedDB.cmp(void 0, true)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(true, void 0)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(void 0, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', void 0)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(true, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', true)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(true, false)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(false, true)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(true, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', true)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(false, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', false)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(false, NaN)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(NaN, false)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(false, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', false)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(NaN, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', NaN)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(NaN, null)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(null, NaN)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(NaN, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', NaN)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(null, 'valid')
+PASS Exception was thrown.
+PASS code is IDBDatabaseException.DATA_ERR
+Expecting exception from indexedDB.cmp('valid', null)
+PASS Exception was thrown.
+PASS code is IDBDatabaseException.DATA_ERR
+Expecting exception from indexedDB.cmp(null, {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp({}, null)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(null, 'valid')
+PASS Exception was thrown.
+PASS code is IDBDatabaseException.DATA_ERR
+Expecting exception from indexedDB.cmp('valid', null)
+PASS Exception was thrown.
+PASS code is IDBDatabaseException.DATA_ERR
+Expecting exception from indexedDB.cmp({}, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp({}, function () {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(function () {}, {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp({}, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(function () {}, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', function () {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(function () {}, /regex/)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(/regex/, function () {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(function () {}, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', function () {})
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(/regex/, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', /regex/)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(/regex/, window)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window, /regex/)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(/regex/, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', /regex/)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', window)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window, window.document)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document, window)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', window)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', window.document)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document, window.document.body)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document.body, window.document)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', window.document)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp(window.document.body, 'valid')
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+Expecting exception from indexedDB.cmp('valid', window.document.body)
+PASS Exception was thrown.
+FAIL code should be 5. Was 17.
+
+compare identical keys
+PASS indexedDB.cmp(0, -0) === 0 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/indexeddb/factory-cmp.html (0 => 97168)
--- trunk/LayoutTests/storage/indexeddb/factory-cmp.html (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/factory-cmp.html 2011-10-11 19:22:14 UTC (rev 97168)
@@ -0,0 +1,161 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB key comparison using IDBFactory.cmp().");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
+ shouldBeFalse("indexedDB == null");
+ IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
+ shouldBeFalse("IDBDatabaseException == null");
+
+ shouldBeTrue("typeof indexedDB.cmp === 'function'");
+
+ testValidKeys();
+ testInvalidKeys();
+ testIdenticalKeys();
+ done();
+}
+
+function testValidKeys()
+{
+ debug("");
+ debug("compare valid keys");
+
+ debug("(Array keys are not yet implemented so many tests will fail)");
+
+ var keys = [
+ "-Infinity",
+ "-Number.MAX_VALUE",
+ "-1",
+ "-Number.MIN_VALUE",
+ "0",
+ "Number.MIN_VALUE",
+ "1",
+ "Number.MAX_VALUE",
+ "Infinity",
+
+ "new Date(0)",
+ "new Date(1000)",
+ "new Date(1317399931023)",
+
+ "''",
+ "'\x00'",
+ "'a'",
+ "'aa'",
+ "'b'",
+ "'ba'",
+
+ "'\xA2'", // U+00A2 CENT SIGN
+ "'\u6C34'", // U+6C34 CJK UNIFIED IDEOGRAPH (water)
+ "'\uD834\uDD1E'", // U+1D11E MUSICAL SYMBOL G-CLEF (UTF-16 surrogate pair)
+ "'\uFFFD'", // U+FFFD REPLACEMENT CHARACTER
+
+ // FIXME: Array keys are NYI, but these should pass once implemented
+ "[]",
+
+ "[-Infinity]",
+ "[-1.7976931348623157e+308]",
+ "[-1]",
+ "[-5e-324]",
+ "[0]",
+ "[5e-324]",
+ "[1]",
+ "[1.7976931348623157e+308]",
+ "[Infinity]",
+
+ "[new Date(0)]",
+ "[new Date(1000)]",
+ "[new Date(1317399931023)]",
+
+ "['']",
+ "['\x00']",
+ "['a']",
+ "['aa']",
+ "['b']",
+ "['ba']",
+
+ "['\xA2']", // U+00A2 CENT SIGN
+ "['\u6C34']", // U+6C34 CJK UNIFIED IDEOGRAPH (water)
+ "['\uD834\uDD1E']", // U+1D11E MUSICAL SYMBOL G-CLEF (UTF-16 surrogate pair)
+ "['\uFFFD']", // U+FFFD REPLACEMENT CHARACTER
+
+ "[[]]",
+
+ "[[], []]",
+ "[[], [], []]",
+
+ "[[[]]]",
+ "[[[[]]]]",
+ ];
+
+ var i, key1, key2;
+ for (i = 0; i < keys.length - 1; i += 1) {
+ key1 = keys[i];
+ key2 = keys[i + 1];
+ shouldBeTrue("indexedDB.cmp(" + key1 + "," + key2 + ") === -1");
+ shouldBeTrue("indexedDB.cmp(" + key2 + "," + key1 + ") === 1");
+ shouldBeTrue("indexedDB.cmp(" + key1 + "," + key1 + ") === 0");
+ shouldBeTrue("indexedDB.cmp(" + key2 + "," + key2 + ") === 0");
+ }
+}
+
+function testInvalidKeys()
+{
+ debug("");
+ debug("compare invalid keys");
+
+ var invalidKeys = [
+ "void 0", // undefined
+ "true",
+ "false",
+ "NaN",
+ "null",
+ "{}",
+ "function () {}",
+ "/regex/",
+ "window",
+ "window.document",
+ "window.document.body"
+ ];
+
+ var i, key1, key2;
+ for (i = 0; i < invalidKeys.length - 1; i += 1) {
+ key1 = invalidKeys[i];
+ key2 = invalidKeys[i + 1];
+ evalAndExpectException("indexedDB.cmp(" + key1 + ", " + key2 + ")", "IDBDatabaseException.DATA_ERR");
+ evalAndExpectException("indexedDB.cmp(" + key2 + ", " + key1 + ")", "IDBDatabaseException.DATA_ERR");
+ evalAndExpectException("indexedDB.cmp(" + key1 + ", 'valid')", "IDBDatabaseException.DATA_ERR");
+ evalAndExpectException("indexedDB.cmp('valid', " + key1 + ")", "IDBDatabaseException.DATA_ERR");
+ evalAndExpectException("indexedDB.cmp(" + key2 + ", 'valid')", "IDBDatabaseException.DATA_ERR");
+ evalAndExpectException("indexedDB.cmp('valid', " + key2 + ")", "IDBDatabaseException.DATA_ERR");
+ }
+}
+
+function testIdenticalKeys()
+{
+ debug("");
+ debug("compare identical keys");
+
+ shouldBeTrue("indexedDB.cmp(0, -0) === 0");
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>