Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8270)

Unified Diff: chrome/test/data/extensions/api_test/storage/background.html

Issue 173306: Force databases and localstorage to be enabled extensions. (Closed)
Patch Set: cleanup Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/storage/background.html
diff --git a/chrome/test/data/extensions/api_test/storage/background.html b/chrome/test/data/extensions/api_test/storage/background.html
new file mode 100644
index 0000000000000000000000000000000000000000..b704b2df619185eae4be141737b683712b6d7597
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/storage/background.html
@@ -0,0 +1,22 @@
+<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");
+ 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')", []);
+ }, function(error) {
+ 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"
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698