Commit 51e07477 authored by mnaganov@chromium.org's avatar mnaganov@chromium.org
Browse files

2011-02-16 Sheriff Bot <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r78655.
        http://trac.webkit.org/changeset/78655
        https://bugs.webkit.org/show_bug.cgi?id=54543

        Causes too many test failures in chromium (Requested by
        mnaganov on #webkit).

        * storage/indexeddb/exception-in-event-aborts-expected.txt: Removed.
        * storage/indexeddb/exception-in-event-aborts.html: Removed.
        * storage/indexeddb/queued-commands-expected.txt:
        * storage/indexeddb/queued-commands.html:
        * storage/indexeddb/request-event-propagation-expected.txt:
        * storage/indexeddb/request-event-propagation.html:
        * storage/indexeddb/resources/shared.js:
        (unexpectedErrorCallback):
        * storage/indexeddb/transaction-event-propagation-expected.txt:
        * storage/indexeddb/transaction-event-propagation.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 74b83795
2011-02-16 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r78655.
http://trac.webkit.org/changeset/78655
https://bugs.webkit.org/show_bug.cgi?id=54543
Causes too many test failures in chromium (Requested by
mnaganov on #webkit).
* storage/indexeddb/exception-in-event-aborts-expected.txt: Removed.
* storage/indexeddb/exception-in-event-aborts.html: Removed.
* storage/indexeddb/queued-commands-expected.txt:
* storage/indexeddb/queued-commands.html:
* storage/indexeddb/request-event-propagation-expected.txt:
* storage/indexeddb/request-event-propagation.html:
* storage/indexeddb/resources/shared.js:
(unexpectedErrorCallback):
* storage/indexeddb/transaction-event-propagation-expected.txt:
* storage/indexeddb/transaction-event-propagation.html:
2011-02-16 Philippe Normand <pnormand@igalia.com>
 
Unreviewed rebaseline GTK media test result.
Test exceptions in IDBRequest handlers cause aborts.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
webkitIndexedDB.open('name')
db = event.target.result
db.setVersion('new version')
setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
trans.oncomplete = startTest
Deleted all object stores.
store = db.createObjectStore('storeName', null)
store.add({x: 'value', y: 'zzz'}, 'key')
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted1
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value2', y: 'zzz2'}, 'key2')
event.preventDefault()
Throwing
PASS The transaction was aborted.
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted2
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value', y: 'zzz'}, 'key')
event.preventDefault()
Throwing
PASS The transaction was aborted.
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = unexpectedAbortCallback
trans.oncomplete = transactionCompleted1
store = trans.objectStore('storeName')
store.add({x: 'value3', y: 'zzz3'}, 'key3')
event.preventDefault()
Throwing within a try block
PASS The transaction completed.
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = unexpectedAbortCallback
trans.oncomplete = transactionCompleted2
store = trans.objectStore('storeName')
store.add({x: 'value4', y: 'zzz4'}, 'key4')
FAIL Success function called unexpectedly.
PASS The transaction completed.
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="../../fast/js/resources/js-test-post-function.js"></script>
<script src="resources/shared.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test exceptions in IDBRequest handlers cause aborts.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function test()
{
request = evalAndLog("webkitIndexedDB.open('name')");
request.onsuccess = setVersion;
request.onerror = unexpectedErrorCallback;
}
function setVersion()
{
db = evalAndLog("db = event.target.result");
request = evalAndLog("db.setVersion('new version')");
request.onsuccess = deleteExisting;
request.onerror = unexpectedErrorCallback;
}
function deleteExisting()
{
debug("setVersionSuccess():");
window.trans = evalAndLog("trans = event.target.result");
shouldBeTrue("trans !== null");
trans.onabort = unexpectedAbortCallback;
evalAndLog("trans.oncomplete = startTest");
deleteAllObjectStores(db);
store = evalAndLog("store = db.createObjectStore('storeName', null)");
request = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
request.onerror = unexpectedErrorCallback;
}
function startTest()
{
debug("");
trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
evalAndLog("trans.onabort = transactionAborted1");
evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
store = evalAndLog("store = trans.objectStore('storeName')");
request = evalAndLog("store.add({x: 'value2', y: 'zzz2'}, 'key2')");
trans.addEventListener('success', causeException, true);
request.onerror = unexpectedErrorCallback;
}
function causeException()
{
debug("");
evalAndLog("event.preventDefault()");
debug("Throwing");
throw "OH NO!!!";
}
function transactionAborted1()
{
debug("");
testPassed("The transaction was aborted.");
trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
evalAndLog("trans.onabort = transactionAborted2");
evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
store = evalAndLog("store = trans.objectStore('storeName')");
request = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
request.onsuccess = unexpectedSuccessCallback;
db.onerror = causeException;
}
function transactionAborted2()
{
debug("");
testPassed("The transaction was aborted.");
trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
evalAndLog("trans.onabort = unexpectedAbortCallback");
evalAndLog("trans.oncomplete = transactionCompleted1");
store = evalAndLog("store = trans.objectStore('storeName')");
request = evalAndLog("store.add({x: 'value3', y: 'zzz3'}, 'key3')");
request.onsuccess = throwAndCatch;
request.onerror = unexpectedErrorCallback;
db.onerror = null;
}
function throwAndCatch()
{
debug("");
evalAndLog("event.preventDefault()");
debug("Throwing within a try block");
try {
throw "AHHH";
} catch (e) {
}
}
function transactionCompleted1()
{
debug("");
testPassed("The transaction completed.");
trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
evalAndLog("trans.onabort = unexpectedAbortCallback");
evalAndLog("trans.oncomplete = transactionCompleted2");
store = evalAndLog("store = trans.objectStore('storeName')");
request = evalAndLog("store.add({x: 'value4', y: 'zzz4'}, 'key4')");
request.onsuccess = unexpectedSuccessCallback;
request.onerror = throwAndCatch;
}
function transactionCompleted2()
{
debug("");
testPassed("The transaction completed.");
debug("");
done();
}
test();
var successfullyParsed = true;
</script>
</body>
</html>
......@@ -10,7 +10,7 @@ setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
Deleted all object stores.
db.createObjectStore('storeName')
db.createObjectStore('storeName', null)
store.createIndex('indexName', 'x')
store.add({x: 'value', y: 'zzz'}, 'key')
store.add({x: 'value2', y: 'zzz2'}, 'key2')
......
......@@ -39,7 +39,7 @@ function deleteExisting()
deleteAllObjectStores(db);
window.store = evalAndLog("db.createObjectStore('storeName')");
window.store = evalAndLog("db.createObjectStore('storeName', null)");
window.indexObject = evalAndLog("store.createIndex('indexName', 'x')");
request = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
......
......@@ -45,8 +45,6 @@ PASS captureFired is false
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is db
In IDBTransaction error capture
PASS dbCaptureFired is true
......@@ -54,8 +52,6 @@ PASS captureFired is false
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is trans
In IDBRequest handler
PASS dbCaptureFired is true
......@@ -63,8 +59,6 @@ PASS captureFired is true
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is request
In IDBTransaction error bubble
PASS dbCaptureFired is true
......@@ -72,8 +66,6 @@ PASS captureFired is true
PASS requestFired is true
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is trans
In IDBDatabase error bubble
PASS dbCaptureFired is true
......@@ -81,8 +73,6 @@ PASS captureFired is true
PASS requestFired is true
PASS bubbleFired is true
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is db
Transaction aborted
PASS dbCaptureFired is true
......@@ -116,8 +106,6 @@ PASS captureFired is false
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is db
In IDBTransaction success capture
PASS dbCaptureFired is true
......@@ -125,8 +113,6 @@ PASS captureFired is false
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is trans
In IDBRequest handler
PASS dbCaptureFired is true
......@@ -134,8 +120,6 @@ PASS captureFired is true
PASS requestFired is false
PASS bubbleFired is false
PASS dbBubbleFired is false
PASS event.target is request
PASS event.currentTarget is request
Transaction completed
PASS dbCaptureFired is true
......
......@@ -101,8 +101,6 @@ function dbErrorCaptureCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
......@@ -115,8 +113,6 @@ function errorCaptureCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "trans");
captureFired = true;
}
......@@ -129,8 +125,6 @@ function errorFiredCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "request");
requestFired = true;
}
......@@ -143,8 +137,6 @@ function errorBubbleCallback()
shouldBeTrue("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "trans");
bubbleFired = true;
}
......@@ -157,8 +149,6 @@ function dbErrorBubbleCallback()
shouldBeTrue("requestFired");
shouldBeTrue("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "db");
dbBubbleFired = true;
}
......@@ -208,8 +198,6 @@ function dbSuccessCaptureCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
......@@ -222,8 +210,6 @@ function successCaptureCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "trans");
captureFired = true;
}
......@@ -236,8 +222,6 @@ function successFiredCallback()
shouldBeFalse("requestFired");
shouldBeFalse("bubbleFired");
shouldBeFalse("dbBubbleFired");
shouldBe("event.target", "request");
shouldBe("event.currentTarget", "request");
requestFired = true;
}
......
......@@ -12,7 +12,7 @@ function unexpectedSuccessCallback()
function unexpectedErrorCallback()
{
testFailed("Error function called unexpectedly: (" + event.target.errorCode + ") " + event.target.webkitErrorMessage);
testFailed("Error function called unexpectedly: (" + event.target.code + ") " + event.target.message);
}
function unexpectedAbortCallback()
......
......@@ -27,22 +27,16 @@ In IDBDatabase abort capture
PASS dbCaptureFired is false
PASS abortFired is false
PASS dbBubbleFired1 is false
PASS event.target is trans
PASS event.currentTarget is db
In abort handler
PASS dbCaptureFired is true
PASS abortFired is false
PASS dbBubbleFired1 is false
PASS event.target is trans
PASS event.currentTarget is trans
In IDBDatabase error bubble
PASS dbCaptureFired is true
PASS abortFired is true
PASS dbBubbleFired1 is false
PASS event.target is trans
PASS event.currentTarget is db
Verifing success.
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
......@@ -63,15 +57,11 @@ In IDBDatabase complete capture
PASS dbCaptureFired is false
PASS completeFired is false
PASS dbBubbleFired2 is false
PASS event.target is trans
PASS event.currentTarget is db
In IDBRequest handler
PASS dbCaptureFired is true
PASS completeFired is false
PASS dbBubbleFired2 is false
PASS event.target is trans
PASS event.currentTarget is trans
PASS successfullyParsed is true
......
......@@ -68,8 +68,6 @@ function dbAbortCaptureCallback()
shouldBeFalse("dbCaptureFired");
shouldBeFalse("abortFired");
shouldBeFalse("dbBubbleFired1");
shouldBe("event.target", "trans");
shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
......@@ -80,8 +78,6 @@ function abortFiredCallback()
shouldBeTrue("dbCaptureFired");
shouldBeFalse("abortFired");
shouldBeFalse("dbBubbleFired1");
shouldBe("event.target", "trans");
shouldBe("event.currentTarget", "trans");
abortFired = true;
}
......@@ -92,8 +88,6 @@ function dbAbortBubbleCallback()
shouldBeTrue("dbCaptureFired");
shouldBeTrue("abortFired");
shouldBeFalse("dbBubbleFired1");
shouldBe("event.target", "trans");
shouldBe("event.currentTarget", "db");
dbBubbleFired1 = true;
debug("");
debug("Verifing success.");
......@@ -122,8 +116,6 @@ function dbCompleteCaptureCallback()
shouldBeFalse("dbCaptureFired");
shouldBeFalse("completeFired");
shouldBeFalse("dbBubbleFired2");
shouldBe("event.target", "trans");
shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
......@@ -134,8 +126,6 @@ function completeFiredCallback()
shouldBeTrue("dbCaptureFired");
shouldBeFalse("completeFired");
shouldBeFalse("dbBubbleFired2");
shouldBe("event.target", "trans");
shouldBe("event.currentTarget", "trans");
completeFired = true;
debug("");
done();
......
2011-02-16 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r78655.
http://trac.webkit.org/changeset/78655
https://bugs.webkit.org/show_bug.cgi?id=54543
Causes too many test failures in chromium (Requested by
mnaganov on #webkit).
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSEventTarget.cpp:
(WebCore::toJS):
* bindings/v8/V8AbstractEventListener.cpp:
(WebCore::V8AbstractEventListener::invokeEventHandler):
* dom/EventTarget.cpp:
* dom/EventTarget.h:
* storage/IDBRequest.cpp:
* storage/IDBRequest.h:
2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
 
Reviewed by Yury Semikhatsky.
......@@ -126,10 +126,9 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
globalObject->setCurrentEvent(savedEvent);
if (exec->hadException()) {
event->target()->uncaughtExceptionInEventHandler();
if (exec->hadException())
reportCurrentException(exec);
} else {
else {
if (!retval.isUndefinedOrNull() && event->storesResultAsString())
event->storeResult(ustringToString(retval.toString(exec)));
if (m_isAttribute) {
......
......@@ -160,14 +160,8 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget* targ
#endif
#if ENABLE(INDEXED_DATABASE)
if (IDBDatabase* idbDatabase = target->toIDBDatabase())
return toJS(exec, idbDatabase);
if (IDBRequest* idbRequest = target->toIDBRequest())
return toJS(exec, idbRequest);
if (IDBTransaction* idbTransaction = target->toIDBTransaction())
return toJS(exec, idbTransaction);
#endif
#if ENABLE(WEB_AUDIO)
......
......@@ -147,14 +147,8 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context
v8Context->Global()->SetHiddenValue(eventSymbol, jsEvent);
tryCatch.Reset();
{
v8::TryCatch innerTryCatch;
returnValue = callListenerFunction(context, jsEvent, event);
if (innerTryCatch.HasCaught())
event->target()->uncaughtExceptionInEventHandler();
innerTryCatch.Reset();
}
// Call the event handler.
returnValue = callListenerFunction(context, jsEvent, event);
if (!tryCatch.CanContinue())
return;
......
......@@ -301,10 +301,6 @@ bool EventTarget::dispatchEvent(PassRefPtr<Event> event)
return fireEventListeners(event.get());
}
void EventTarget::uncaughtExceptionInEventHandler()
{
}
bool EventTarget::fireEventListeners(Event* event)
{
ASSERT(!eventDispatchForbidden());
......
......@@ -151,7 +151,6 @@ namespace WebCore {
virtual void removeAllEventListeners();
virtual bool dispatchEvent(PassRefPtr<Event>);
bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); // DOM API
virtual void uncaughtExceptionInEventHandler();
// Used for legacy "onEvent" attribute APIs.
bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
......
......@@ -246,12 +246,6 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
return dontPreventDefault;
}
void IDBRequest::uncaughtExceptionInEventHandler()
{
if (m_transaction)
m_transaction->backend()->abort();
}
void IDBRequest::enqueueEvent(PassRefPtr<Event> event)
{
ASSERT(!m_finished);
......
......@@ -85,7 +85,6 @@ public:
virtual ScriptExecutionContext* scriptExecutionContext() const;
virtual bool dispatchEvent(PassRefPtr<Event>);
bool dispatchEvent(PassRefPtr<Event> event, ExceptionCode& ec) { return EventTarget::dispatchEvent(event, ec); }
virtual void uncaughtExceptionInEventHandler();
using ThreadSafeShared<IDBCallbacks>::ref;
using ThreadSafeShared<IDBCallbacks>::deref;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment