| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../inspector/inspector-test.js"></script> | 4 <script src="../inspector/inspector-test.js"></script> |
| 5 <script src="../inspector/resources-test.js"></script> | 5 <script src="../inspector/resources-test.js"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 function onload() | 9 function onload() |
| 10 { | 10 { |
| 11 if (window.testRunner) | 11 if (window.testRunner) |
| 12 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
| 13 | 13 |
| 14 var db = openDatabase("InspectorDatabaseTest", "1.0", "Test of database inst
rumentation", 1); | 14 var db = openDatabase("InspectorDatabaseTest", "1.0", "Test of database inst
rumentation", 1); |
| 15 var db2 = openDatabase("InspectorDatabaseTest2", "1.0", "Test of database in
strumentation 2", 1); |
| 15 | 16 |
| 16 if (window.testRunner) | 17 if (window.testRunner) |
| 17 testRunner.showWebInspector(); | 18 testRunner.showWebInspector(); |
| 18 runTest(); | 19 runTest(); |
| 19 } | 20 } |
| 20 | 21 |
| 21 function test() | 22 function test() |
| 22 { | 23 { |
| 23 InspectorTest.databaseModel().enable(); | 24 InspectorTest.databaseModel().enable(); |
| 24 function run() | 25 function run() |
| 25 { | 26 { |
| 27 function compareByName(d1, d2) |
| 28 { |
| 29 if (d1.name < d2.name) |
| 30 return -1; |
| 31 if (d1.name > d2.name) |
| 32 return 1; |
| 33 return 0; |
| 34 } |
| 35 |
| 26 var databases = InspectorTest.databaseModel().databases(); | 36 var databases = InspectorTest.databaseModel().databases(); |
| 37 databases.sort(compareByName); |
| 27 for (var i = 0; i < databases.length; ++i) { | 38 for (var i = 0; i < databases.length; ++i) { |
| 28 InspectorTest.addResult("Name: " + databases[i].name); | 39 InspectorTest.addResult("Name: " + databases[i].name); |
| 29 InspectorTest.addResult("Version: " + databases[i].version); | 40 InspectorTest.addResult("Version: " + databases[i].version); |
| 30 InspectorTest.addResult("Domain: " + databases[i].domain); | 41 InspectorTest.addResult("Domain: " + databases[i].domain); |
| 31 } | 42 } |
| 32 InspectorTest.completeTest(); | 43 InspectorTest.completeTest(); |
| 33 } | 44 } |
| 34 InspectorTest.runAfterPendingDispatches(run); | 45 InspectorTest.runAfterPendingDispatches(run); |
| 35 } | 46 } |
| 36 | 47 |
| 37 </script> | 48 </script> |
| 38 | 49 |
| 39 </head> | 50 </head> |
| 40 <body onload="onload()"> | 51 <body onload="onload()"> |
| 41 <p>Tests that Web Inspector gets populated with databases that were opened befor
e inspector is shown.</p> | 52 <p>Tests that Web Inspector gets populated with databases that were opened befor
e inspector is shown.</p> |
| 42 </body> | 53 </body> |
| 43 </html> | 54 </html> |
| OLD | NEW |