Commit 5cf91c75 authored by eric@webkit.org's avatar eric@webkit.org

2010-04-30 Sheriff Bot <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r58569.
        http://trac.webkit.org/changeset/58569
        https://bugs.webkit.org/show_bug.cgi?id=38399

        This broke the GTK bots due to bad GC behavior (Requested by
        ericu on #webkit).

        * fast/workers/change-version-handle-reuse-worker-expected.txt: Removed.
        * fast/workers/change-version-handle-reuse-worker.html: Removed.
        * fast/workers/execute-sql-args-worker-expected.txt: Removed.
        * fast/workers/execute-sql-args-worker.html: Removed.
        * fast/workers/resources/database-worker-controller.js: Removed.
        * fast/workers/resources/database-worker.js: Removed.
        * storage/change-version-handle-reuse-expected.txt:
        * storage/change-version-handle-reuse.html:
        * storage/change-version-handle-reuse.js: Removed.
        * storage/execute-sql-args.html:
        * storage/execute-sql-args.js: Removed.
2010-04-30  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r58569.
        http://trac.webkit.org/changeset/58569
        https://bugs.webkit.org/show_bug.cgi?id=38399

        This broke the GTK bots due to bad GC behavior (Requested by
        ericu on #webkit).

        * bindings/js/JSWorkerContextCustom.cpp:
        * bindings/v8/custom/V8WorkerContextCustom.cpp:
        * storage/Database.idl:
        * storage/SQLError.idl:
        * storage/SQLResultSet.idl:
        * storage/SQLResultSetRowList.idl:
        * storage/SQLTransaction.idl:
        * workers/WorkerContext.cpp:
        (WebCore::WorkerContext::openDatabase):
        * workers/WorkerContext.h:
        (WebCore::WorkerContext::databaseExceededQuota):
        * workers/WorkerContext.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 95ef1714
2010-04-30 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r58569.
http://trac.webkit.org/changeset/58569
https://bugs.webkit.org/show_bug.cgi?id=38399
This broke the GTK bots due to bad GC behavior (Requested by
ericu on #webkit).
* fast/workers/change-version-handle-reuse-worker-expected.txt: Removed.
* fast/workers/change-version-handle-reuse-worker.html: Removed.
* fast/workers/execute-sql-args-worker-expected.txt: Removed.
* fast/workers/execute-sql-args-worker.html: Removed.
* fast/workers/resources/database-worker-controller.js: Removed.
* fast/workers/resources/database-worker.js: Removed.
* storage/change-version-handle-reuse-expected.txt:
* storage/change-version-handle-reuse.html:
* storage/change-version-handle-reuse.js: Removed.
* storage/execute-sql-args.html:
* storage/execute-sql-args.js: Removed.
2010-04-30 Yaar Schnitman <yaar@chromium.org>
Not Reviewed.
......
This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions.
changeVersion: transaction callback
changeVersion: success callback
transaction: statement error callback: no such table: FooBar
TEST COMPLETE.
<html>
<head>
<script src="resources/database-worker-controller.js"></script>
<script>
function setupAndRunTest()
{
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
document.getElementById("console").innerText = "";
databaseWorker.postMessage("importScripts:../../storage/change-version-handle-reuse.js");
databaseWorker.postMessage("runTest");
}
</script>
</head>
<body onload="setupAndRunTest()">
<div>This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions.
<pre id="console">
FAILURE: test didn't run.
</pre>
</body>
</html>
PASS. executeSql(null) did not throw an exception
PASS. executeSql(undefined) did not throw an exception
PASS. executeSql(0) did not throw an exception
PASS. executeSql("") did not throw an exception
PASS. executeSql("", null) did not throw an exception
PASS. executeSql("", undefined) did not throw an exception
PASS. executeSql("", []) did not throw an exception
PASS. executeSql("", [ "arg0" ]) did not throw an exception
PASS. executeSql("", { }) did not throw an exception
PASS. executeSql("", { length: 0 }) did not throw an exception
PASS. executeSql("", { length: 1, 0: "arg0" }) did not throw an exception
PASS. executeSql("", null, null) did not throw an exception
PASS. executeSql("", null, undefined) did not throw an exception
PASS. executeSql("", null, { }) did not throw an exception
PASS. executeSql("", null, null, null) did not throw an exception
PASS. executeSql("", null, null, undefined) did not throw an exception
PASS. executeSql("", null, null, { }) did not throw an exception
PASS. executeSql() threw an exception as expected.
PASS. executeSql(throwOnToStringObject) threw an exception as expected.
PASS. executeSql("", throwOnGetLengthObject) threw an exception as expected.
PASS. executeSql("", throwOnGetZeroObject) threw an exception as expected.
PASS. executeSql("", [ throwOnToStringObject ]) threw an exception as expected.
PASS. executeSql("", 0) threw an exception as expected.
PASS. executeSql("", "") threw an exception as expected.
PASS. executeSql("", null, 0) threw an exception as expected.
PASS. executeSql("", null, "") threw an exception as expected.
PASS. executeSql("", null, null, 0) threw an exception as expected.
PASS. executeSql("", null, null, "") threw an exception as expected.
<html>
<head>
<script src="resources/database-worker-controller.js"></script>
<script>
function setupAndRunTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
databaseWorker.postMessage("importScripts:../../storage/execute-sql-args.js");
databaseWorker.postMessage("runTest");
}
</script>
</head>
<body onload="setupAndRunTest()">
<pre id="console"></pre>
</body>
</html>
var databaseWorker = new Worker('resources/database-worker.js');
databaseWorker.onmessage = function(event) {
if (event.data.indexOf('log:') == 0)
log(event.data.substring(4));
else if (event.data == 'notifyDone') {
if (window.layoutTestController)
layoutTestController.notifyDone();
} else
throw new Error("Unrecognized message: " + event);
}
function log(message)
{
document.getElementById("console").innerText += message + "\n";
}
var window = {
layoutTestController: {
notifyDone: function() { postMessage("notifyDone"); }
}
};
var layoutTestController = window.layoutTestController;
function log(s) {
postMessage("log:" + s);
}
onmessage = function(event) {
try {
if (event.data.indexOf("importScripts:") == 0) {
var scripts = event.data.substring("importScripts:".length).split(",");
for (var i in scripts)
scripts[i] = "../" + scripts[i];
importScripts(scripts);
} else if (event.data == "runTest")
runTest(); // Must be defined by some imported script.
else
log("Received unexpected message: " + event.data);
} catch (ex) {
log("Worker caught exception: " + ex);
window.layoutTestController.notifyDone();
}
};
var DB_TEST_SUFFIX = "_worker";
This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions.
This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions. Also, reloading the page should not cause an assertion failure.
changeVersion: transaction callback
changeVersion: success callback
transaction: statement error callback: no such table: FooBar
......
<html>
<head>
<script src="change-version-handle-reuse.js"></script>
<script>
var DB_TEST_SUFFIX = "_dom";
function log(message)
{
document.getElementById("console").innerText += message + "\n";
document.getElementById("result").innerText += message + "\n";
}
function finishTest()
{
log("TEST COMPLETE.");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function setupAndRunTest()
function runTest()
{
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
document.getElementById("console").innerText = "";
document.getElementById("result").innerText = "";
runTest();
try {
db = openDatabase("ChangeVersion", "", "Test that changing a database version doesn\'t kill our handle to it", 1);
var version = db.version;
var newVersion = version ? (parseInt(version) + 1).toString() : "1";
db.changeVersion(version, newVersion, function(tx) {
log("changeVersion: transaction callback");
}, function(error) {
log("changeVersion: error callback: " + error.message);
}, function() {
log("changeVersion: success callback");
});
setTimeout(runTest2, 1000);
} catch (e) {
log("changeVersion exception: " + e);
finishTest();
}
}
function runTest2()
{
try {
db.transaction(function(tx) {
tx.executeSql("SELECT * from FooBar", [], function(tx) {
log("transaction: statement callback");
finishTest();
}, function(tx, error) {
log("transaction: statement error callback: " + error.message);
finishTest();
});
});
} catch (e) {
log("transaction exception: " + e);
finishTest();
}
}
</script>
</head>
<body onload="setupAndRunTest()">
<div>This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions.
<pre id="console">
<body onload="runTest()">
<div>This tests that a database can be accessed after changing its version. You should see an error about FooBar table below, not about mismatching versions. Also, reloading the page should not cause an assertion failure.
<pre id="result">
FAILURE: test didn't run.
</pre>
</body>
......
function finishTest()
{
log("TEST COMPLETE.");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function runTest()
{
try {
db = openDatabase("ChangeVersion" + DB_TEST_SUFFIX, "", "Test that changing a database version doesn't kill our handle to it", 1);
var version = db.version;
var newVersion = version ? (parseInt(version) + 1).toString() : "1";
db.changeVersion(version, newVersion, function(tx) {
log("changeVersion: transaction callback");
}, function(error) {
log("changeVersion: error callback: " + error.message);
}, function() {
log("changeVersion: success callback");
runTest2();
});
} catch (e) {
log("changeVersion exception: " + e);
finishTest();
}
}
function runTest2()
{
try {
db.transaction(function(tx) {
tx.executeSql("SELECT * from FooBar", [], function(tx) {
log("transaction: statement callback");
finishTest();
}, function(tx, error) {
log("transaction: statement error callback: " + error.message);
finishTest();
});
});
} catch (e) {
log("transaction exception: " + e);
finishTest();
}
}
<html>
<head>
<script src="execute-sql-args.js"></script>
<script>
var DB_TEST_SUFFIX = "_dom";
var throwOnToStringObject = { };
throwOnToStringObject.toString = function () { throw "Cannot call toString on this object." };
function log(message)
var throwOnGetLengthObject = { };
throwOnGetLengthObject.__defineGetter__("length", function () { throw "Cannot get length of this object."; });
var throwOnGetZeroObject = { length: 1 };
throwOnGetZeroObject.__defineGetter__("0", function () { throw "Cannot get 0 property of this object."; });
var expectNoException = [
'null',
'undefined',
'0',
'""',
'"", null',
'"", undefined',
'"", []',
'"", [ "arg0" ]',
'"", { }',
'"", { length: 0 }',
'"", { length: 1, 0: "arg0" }',
'"", null, null',
'"", null, undefined',
'"", null, { }',
'"", null, null, null',
'"", null, null, undefined',
'"", null, null, { }',
];
var expectException = [
'',
'throwOnToStringObject',
'"", throwOnGetLengthObject',
'"", throwOnGetZeroObject',
'"", [ throwOnToStringObject ]',
'"", 0',
'"", ""',
'"", null, 0',
'"", null, ""',
'"", null, null, 0',
'"", null, null, ""',
];
function writeMessageToLog(message)
{
document.getElementById("console").innerText += message + "\n";
}
function setupAndRunTest()
function tryExecuteSql(transaction, parameterList)
{
try {
eval('transaction.executeSql(' + parameterList + ')');
return null;
} catch (exception) {
return exception;
}
}
function runTransactionTest(transaction, parameterList, expectException)
{
var exception = tryExecuteSql(transaction, parameterList);
if (expectException) {
if (exception)
writeMessageToLog("PASS. executeSql(" + parameterList + ") threw an exception as expected.");
else
writeMessageToLog("*FAIL*. executeSql(" + parameterList + ") did not throw an exception");
} else {
if (exception)
writeMessageToLog("*FAIL*. executeSql(" + parameterList + ") threw an exception: " + exception);
else
writeMessageToLog("PASS. executeSql(" + parameterList + ") did not throw an exception");
}
}
function runTransactionTests(transaction)
{
for (i in expectNoException)
runTransactionTest(transaction, expectNoException[i], false);
for (i in expectException)
runTransactionTest(transaction, expectException[i], true);
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function runTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
runTest();
var db = openDatabase("ExecuteSQLArgsTest", "1.0", "Test of handling of the arguments to SQLTransaction.executeSql", 1);
db.transaction(runTransactionTests);
}
</script>
</head>
<body onload="setupAndRunTest()">
<body onload="runTest()">
<pre id="console"></pre>
</body>
......
var throwOnToStringObject = { };
throwOnToStringObject.toString = function () { throw "Cannot call toString on this object." };
var throwOnGetLengthObject = { };
throwOnGetLengthObject.__defineGetter__("length", function () { throw "Cannot get length of this object."; });
var throwOnGetZeroObject = { length: 1 };
throwOnGetZeroObject.__defineGetter__("0", function () { throw "Cannot get 0 property of this object."; });
var expectNoException = [
'null',
'undefined',
'0',
'""',
'"", null',
'"", undefined',
'"", []',
'"", [ "arg0" ]',
'"", { }',
'"", { length: 0 }',
'"", { length: 1, 0: "arg0" }',
'"", null, null',
'"", null, undefined',
'"", null, { }',
'"", null, null, null',
'"", null, null, undefined',
'"", null, null, { }',
];
var expectException = [
'',
'throwOnToStringObject',
'"", throwOnGetLengthObject',
'"", throwOnGetZeroObject',
'"", [ throwOnToStringObject ]',
'"", 0',
'"", ""',
'"", null, 0',
'"", null, ""',
'"", null, null, 0',
'"", null, null, ""',
];
function tryExecuteSql(transaction, parameterList)
{
try {
eval('transaction.executeSql(' + parameterList + ')');
return null;
} catch (exception) {
return exception;
}
}
function runTransactionTest(transaction, parameterList, expectException)
{
var exception = tryExecuteSql(transaction, parameterList);
if (expectException) {
if (exception)
log("PASS. executeSql(" + parameterList + ") threw an exception as expected.");
else
log("*FAIL*. executeSql(" + parameterList + ") did not throw an exception");
} else {
if (exception)
log("*FAIL*. executeSql(" + parameterList + ") threw an exception: " + exception);
else
log("PASS. executeSql(" + parameterList + ") did not throw an exception");
}
}
function runTransactionTests(transaction)
{
for (i in expectNoException)
runTransactionTest(transaction, expectNoException[i], false);
for (i in expectException)
runTransactionTest(transaction, expectException[i], true);
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function runTest()
{
var db = openDatabase("ExecuteSQLArgsTest" + DB_TEST_SUFFIX, "1.0", "Test of handling of the arguments to SQLTransaction.executeSql", 1);
db.transaction(runTransactionTests);
}
2010-04-30 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r58569.
http://trac.webkit.org/changeset/58569
https://bugs.webkit.org/show_bug.cgi?id=38399
This broke the GTK bots due to bad GC behavior (Requested by
ericu on #webkit).
* bindings/js/JSWorkerContextCustom.cpp:
* bindings/v8/custom/V8WorkerContextCustom.cpp:
* storage/Database.idl:
* storage/SQLError.idl:
* storage/SQLResultSet.idl:
* storage/SQLResultSetRowList.idl:
* storage/SQLTransaction.idl:
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::openDatabase):
* workers/WorkerContext.h:
(WebCore::WorkerContext::databaseExceededQuota):
* workers/WorkerContext.idl:
2010-04-30 Anders Carlsson <andersca@apple.com>
Fix GTK+ build.
......@@ -29,9 +29,6 @@
#include "JSWorkerContext.h"
#include "Database.h"
#include "JSDatabase.h"
#include "JSDatabaseCallback.h"
#include "JSDOMBinding.h"
#include "JSDOMGlobalObject.h"
#include "JSEventListener.h"
......@@ -145,24 +142,6 @@ JSValue JSWorkerContext::messageChannel(ExecState* exec) const
}
#endif
#if ENABLE(DATABASE)
JSValue JSWorkerContext::openDatabase(ExecState* exec, const ArgList& args)
{
const UString& name = args.at(0).toString(exec);
const UString& version = args.at(1).toString(exec);
const UString& displayName = args.at(2).toString(exec);
unsigned long estimatedSize = args.at(3).toInt32(exec);
RefPtr<DatabaseCallback> creationCallback;
if ((args.size() >= 5) && args.at(4).isObject())
creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject());
ExceptionCode ec = 0;
JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(ustringToString(name), ustringToString(version), ustringToString(displayName), estimatedSize, creationCallback.release(), ec)));
setDOMException(exec, ec);
return result;
}
#endif
} // namespace WebCore
#endif // ENABLE(WORKERS)
......@@ -37,8 +37,6 @@
#include "ExceptionCode.h"
#include "ScheduledAction.h"
#include "V8Binding.h"
#include "V8Database.h"
#include "V8DatabaseCallback.h"
#include "V8Proxy.h"
#include "V8Utilities.h"
#include "V8WorkerContextEventListener.h"
......@@ -138,12 +136,6 @@ v8::Handle<v8::Value> toV8(WorkerContext* impl)
return global;
}
v8::Handle<v8::Value> V8WorkerContext::openDatabaseCallback(const v8::Arguments& args)
{
INC_STATS("DOM.WorkerContext.openDatabase()");
// Implementation coming soon.
return throwError(NOT_SUPPORTED_ERR);
}
} // namespace WebCore
#endif // ENABLE(WORKERS)
......@@ -30,8 +30,7 @@ module storage {
interface [
Conditional=DATABASE,
OmitConstructor,
NoStaticTables
OmitConstructor
] Database {
readonly attribute DOMString version;
[Custom] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback);
......
......@@ -30,8 +30,7 @@ module storage {
interface [
Conditional=DATABASE,
OmitConstructor,
NoStaticTables
OmitConstructor
] SQLError {
readonly attribute unsigned long code;
readonly attribute DOMString message;
......
......@@ -30,8 +30,7 @@ module storage {
interface [
Conditional=DATABASE,
OmitConstructor,
NoStaticTables
OmitConstructor
] SQLResultSet {
readonly attribute SQLResultSetRowList rows;
......
......@@ -30,8 +30,7 @@ module storage {
interface [
Conditional=DATABASE,