OLD | NEW |
(Empty) | |
| 1 chrome.test.runTests([function tab() { |
| 2 // Check that the localstorage stuff we stored is still there. |
| 3 chrome.test.assertTrue(localStorage.foo == "bar"); |
| 4 |
| 5 // Check that the database stuff we stored is still there. |
| 6 try { |
| 7 console.log("Opening database..."); |
| 8 var db = window.openDatabase("mydb2", "1.0", "database test", 2048); |
| 9 console.log("DONE opening database"); |
| 10 } catch (err) { |
| 11 console.log("Exception"); |
| 12 console.log(err.message); |
| 13 } |
| 14 if (!db) |
| 15 chrome.test.fail("failed to open database"); |
| 16 |
| 17 console.log("Performing transaction..."); |
| 18 db.transaction(function(tx) { |
| 19 tx.executeSql("select body from note", [], function(tx, results) { |
| 20 chrome.test.assertTrue(results.rows.length == 1); |
| 21 chrome.test.assertTrue(results.rows.item(0).body == "hotdog"); |
| 22 chrome.test.succeed(); |
| 23 }, function(tx, error) { |
| 24 chrome.test.fail(error.message); |
| 25 }); |
| 26 }, function(error) { |
| 27 chrome.test.fail(error.message); |
| 28 }); |
| 29 }]); |
OLD | NEW |