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

Unified Diff: chrome/test/data/database/simple_database.html

Issue 10879018: Convert the Web SQL Database pyauto test to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/test/data/database/database_tester.html ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/database/simple_database.html
===================================================================
--- chrome/test/data/database/simple_database.html (revision 152782)
+++ chrome/test/data/database/simple_database.html (working copy)
@@ -1,77 +0,0 @@
-<html>
-<script>
-
-// Open a Web SQL database.
-var g_db = null;
-if (typeof window.openDatabase == "undefined") {
- document.write("Error: Web SQL databases are not supported.");
-}
-try {
- g_db = openDatabase("test", "1.0", "test database", 1024 * 1024);
-} catch(err) {
- document.write("Error: cannot open database.");
-}
-
-// Creates a table named "table1" with one text column named "data".
-function createTable() {
- if (!g_db)
- return;
- g_db.transaction(
- function(tx) {
- tx.executeSql("CREATE TABLE table1 (data TEXT)");
- },
- function(error) {
- sendValueToTest(error);
- },
- function() {
- sendValueToTest("done");
- });
-}
-
-// Inserts a record into the database.
-function insertRecord(text) {
- g_db.transaction(
- function(tx) {
- tx.executeSql("INSERT INTO table1 VALUES (?)", [text]);
- },
- function(error) {
- sendValueToTest(error);
- },
- function() {
- sendValueToTest("done");
- });
-}
-
-// Gets all the records in the database, ordered by their age.
-function getRecords() {
- g_db.readTransaction(function(tx) {
- tx.executeSql(
- "SELECT data FROM table1 ORDER BY ROWID",
- [],
- function(tx, result) {
- items = "";
- for (var i = 0; i < result.rows.length; i++) {
- if (items != "")
- items += ", ";
- items += result.rows.item(i).data;
- }
- sendValueToTest(items);
- },
- function(tx, error) {
- sendValueToTest(error);
- });
- });
-}
-
-function sendValueToTest(value) {
- //alert(value);
- window.domAutomationController.setAutomationId(0);
- window.domAutomationController.send(value);
-}
-
-</script>
-
-<body>
-This page is used for testing Web SQL databases.
-</body>
-</html>
« no previous file with comments | « chrome/test/data/database/database_tester.html ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698