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

Unified Diff: LayoutTests/fast/workers/storage/use-same-database-in-page-and-workers.html

Issue 561093003: Remove worker support of Web SQL Database. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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: LayoutTests/fast/workers/storage/use-same-database-in-page-and-workers.html
diff --git a/LayoutTests/fast/workers/storage/use-same-database-in-page-and-workers.html b/LayoutTests/fast/workers/storage/use-same-database-in-page-and-workers.html
deleted file mode 100644
index 09b91cce18d8baf9304e1b7a859797b35988b39e..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/workers/storage/use-same-database-in-page-and-workers.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<html>
-<head>
-<script>
-function finishTest()
-{
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function log(message)
-{
- document.getElementById("console").innerHTML += message + "<br>";
-}
-
-function runTest()
-{
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- var db = openDatabase("UseSameDatabaseInPageAndWorkers", "", "", 1);
- db.transaction(function(tx) {
- tx.executeSql("CREATE TABLE IF NOT EXISTS Test(Foo INT)", [],
- function(tx, data) {
- startWorkers();
- insertData(db);
- }, function(tx, error) {
- log("Creating table Test failed: " + error.message);
- finishTest();
- });
- });
-}
-
-var successfulTransactions = 0
-var WORKER_COUNT = 3;
-function startWorkers()
-{
- var databaseWorkers = new Array(WORKER_COUNT);
- for (var i = 0; i < WORKER_COUNT; i++) {
- databaseWorkers[i] = new Worker('resources/use-same-database-in-page-and-workers.js');
- databaseWorkers[i].onerror = function(event) {
- log("Caught an error from a worker: " + event.data);
- finishTest();
- }
- databaseWorkers[i].onmessage = function(event) {
- if (event.data == "transactionSuccessful")
- successCallback();
- else
- log("Unexpected worker message: " + event.data);
- }
- }
-}
-
-function successCallback()
-{
- successfulTransactions++;
- if (successfulTransactions == 100 * (WORKER_COUNT + 1)) {
- log("PASS");
- finishTest();
- }
-}
-
-function errorCallback(error)
-{
- log("executeSql failed: " + error.message);
- finishTest();
-}
-
-function insertData(db)
-{
- for (var i = 0; i < 100; i++) {
- db.transaction(function(tx) {
- tx.executeSql("INSERT INTO Test VALUES (?)", [i], null,
- function(tx, error) { errorCallback(error); });
- }, errorCallback, successCallback);
- }
-}
-</script>
-</head>
-
-<body onload="runTest()">
-Test that we can successfully use the same database in the page and in multiple workers at the same time.
-<pre id="console">
-</pre>
-</body>
-
-</html>

Powered by Google App Engine
This is Rietveld 408576698