summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/extensions/api_test/storage/background.html28
-rw-r--r--chrome/test/data/extensions/api_test/storage/tab.html2
2 files changed, 19 insertions, 11 deletions
diff --git a/chrome/test/data/extensions/api_test/storage/background.html b/chrome/test/data/extensions/api_test/storage/background.html
index 3bd7b24..5e3be5f 100644
--- a/chrome/test/data/extensions/api_test/storage/background.html
+++ b/chrome/test/data/extensions/api_test/storage/background.html
@@ -1,25 +1,31 @@
<script>
// store some stuff in local storage
localStorage.foo = "bar";
-
+
// store some stuff in a database
var db = window.openDatabase("mydb2", "1.0", "database test", 2048);
if (!db)
chrome.test.fail("failed to open database");
db.transaction(function(tx) {
- tx.executeSql("drop table if exists note");
- tx.executeSql("create table note (body text)", []);
- tx.executeSql("insert into note values ('hotdog')", []);
+ tx.executeSql("drop table if exists note", [], null, onSqlError);
+ tx.executeSql("create table note (body text)", [], null, onSqlError);
+ tx.executeSql("insert into note values ('hotdog')", [], onSqlExecuted,
+ onSqlError);
}, function(error) {
chrome.test.fail(error.message);
});
- // Open a tab. This doesn't really prove we're writing to disk, but it is
- // difficult to prove that without shutting down the process. We'll just
- // trust that if this next trick works, that the real testing for local
- // storage is good enough to catch more subtle errors.
- chrome.tabs.create({
- url: "tab.html"
- });
+ function onSqlError(tx, error) {
+ chrome.test.fail(error.message);
+ }
+ function onSqlExecuted() {
+ // Open a tab. This doesn't really prove we're writing to disk, but it is
+ // difficult to prove that without shutting down the process. We'll just
+ // trust that if this next trick works, that the real testing for local
+ // storage is good enough to catch more subtle errors.
+ chrome.tabs.create({
+ url: "tab.html"
+ });
+ }
</script>
diff --git a/chrome/test/data/extensions/api_test/storage/tab.html b/chrome/test/data/extensions/api_test/storage/tab.html
index 1e116e7..675dcaaf 100644
--- a/chrome/test/data/extensions/api_test/storage/tab.html
+++ b/chrome/test/data/extensions/api_test/storage/tab.html
@@ -13,6 +13,8 @@ chrome.test.runTests([function tab() {
chrome.test.assertTrue(results.rows.length == 1);
chrome.test.assertTrue(results.rows.item(0).body == "hotdog");
chrome.test.succeed();
+ }, function(tx, error) {
+ chrome.test.fail(error.message);
});
}, function(error) {
chrome.test.fail(error.message);