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

Unified Diff: third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name.html

Issue 2634473002: [websql] Filenames are utf-8, not latin1. (Closed)
Patch Set: final changes? Created 3 years, 11 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 | « no previous file | third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name.html
diff --git a/third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name.html b/third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name.html
new file mode 100644
index 0000000000000000000000000000000000000000..4ad70e4e4cc7b2d17473f4ea736696cfd554a87b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name.html
@@ -0,0 +1,83 @@
+<html>
+<head>
+<meta charset="utf-8"/>
+<script>
+function log(message)
+{
+ document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function finishTest()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function runTest()
+{
+ if (window.testRunner) {
+ testRunner.clearAllDatabases();
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ var transactionsRun = 0;
+
+ // Open database with non-ASCII name.
+ var db = openDatabase("¥£€$", "1.0", "utf8 db test", 1024 * 1024);
+ if (!db) {
+ log("Database creation failed");
+ finishTest();
+ return
+ }
+ log("Database creation succeeded");
+
+ db.transaction(function(t) {
+ t.executeSql("DROP TABLE IF EXISTS t");
+ t.executeSql("CREATE TABLE t (id INTEGER PRIMARY KEY, v TEXT)");
+ t.executeSql("INSERT INTO t VALUES (1, 'hello')");
+ t.executeSql("INSERT INTO t VALUES (2, 'world')");
+ }, function(e) {
+ log("Update transaction failed: " + e.message);
+ finishTest();
+ }, function() {
+ log("Update transaction succeeded");
+ db.transaction(function(t) {
+ t.executeSql("SELECT * FROM t ORDER BY id", [], function (t, r) {
+ if (r.rows.length != 2) {
+ log("Wrong number of rows returned");
+ finishTest();
+ } else if (r.rows.item(0).id != 1) {
+ log("Unexpected row 0.id");
+ finishTest();
+ } else if (r.rows.item(0).v != 'hello') {
+ log("Unexpected row 0.v");
+ finishTest();
+ } else if (r.rows.item(1).id != 2) {
+ log("Unexpected row 1.id");
+ finishTest();
+ } else if (r.rows.item(1).v != 'world') {
+ log("Unexpected row 1.v");
+ finishTest();
+ }
+ });
+ }, function(e) {
+ log("Read transaction failed: " + e.message);
+ finishTest();
+ }, function() {
+ log("Read transaction succeeded");
+ finishTest();
+ });
+ });
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+Test openDatabase() with name outside the ASCII set.
+<pre id="console">
+</pre>
+</body>
+
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/websql/open-database-utf8-name-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698