Diff
Modified: trunk/LayoutTests/ChangeLog (123697 => 123698)
--- trunk/LayoutTests/ChangeLog 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/LayoutTests/ChangeLog 2012-07-26 02:30:34 UTC (rev 123698)
@@ -1,3 +1,16 @@
+2012-07-25 Xingnan Wang <xingnan.w...@intel.com>
+
+ IndexedDB: IDBTransaction::abort() should throw DOMException
+ https://bugs.webkit.org/show_bug.cgi?id=92069
+
+ Reviewed by Kentaro Hara.
+
+ Add the exception test for IDBTransaction::abort().
+
+ * storage/indexeddb/resources/transaction-abort.js:
+ (transactionAborted):
+ * storage/indexeddb/transaction-abort-expected.txt:
+
2012-07-25 Joshua Netterfield <jnetterfi...@rim.com>
[BlackBerry] Update fast/canvas/webgl expectations
Modified: trunk/LayoutTests/storage/indexeddb/resources/transaction-abort.js (123697 => 123698)
--- trunk/LayoutTests/storage/indexeddb/resources/transaction-abort.js 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-abort.js 2012-07-26 02:30:34 UTC (rev 123698)
@@ -90,6 +90,9 @@
abortFired = true;
evalAndExpectException("store.add({x: 'value5', y: 'zzz5'}, 'key5')", "IDBDatabaseException.TRANSACTION_INACTIVE_ERR", "'TransactionInactiveError'");
+
+ evalAndExpectException("trans.abort()", "DOMException.INVALID_STATE_ERR", "'InvalidStateError'");
+
finishJSTest();
}
Modified: trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt (123697 => 123698)
--- trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt 2012-07-26 02:30:34 UTC (rev 123698)
@@ -45,6 +45,10 @@
PASS Exception was thrown.
PASS code is IDBDatabaseException.TRANSACTION_INACTIVE_ERR
PASS ename is 'TransactionInactiveError'
+Expecting exception from trans.abort()
+PASS Exception was thrown.
+PASS code is DOMException.INVALID_STATE_ERR
+PASS ename is 'InvalidStateError'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/Source/WebCore/ChangeLog (123697 => 123698)
--- trunk/Source/WebCore/ChangeLog 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/Source/WebCore/ChangeLog 2012-07-26 02:30:34 UTC (rev 123698)
@@ -1,3 +1,22 @@
+2012-07-25 Xingnan Wang <xingnan.w...@intel.com>
+
+ IndexedDB: IDBTransaction::abort() should throw DOMException
+ https://bugs.webkit.org/show_bug.cgi?id=92069
+
+ Reviewed by Kentaro Hara.
+
+ Keep aligned with the W3C spec.
+ http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBTransaction-abort-void
+
+ Test: storage/indexeddb/transaction-abort.html.
+
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::abort):
+ (WebCore):
+ * Modules/indexeddb/IDBTransaction.h:
+ (IDBTransaction):
+ * Modules/indexeddb/IDBTransaction.idl:
+
2012-07-25 Tony Chang <t...@chromium.org>
flexitems can overflow the flexbox due to rounding
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (123697 => 123698)
--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2012-07-26 02:30:34 UTC (rev 123698)
@@ -458,7 +458,8 @@
if (m_transaction) {
if (event->type() == eventNames().errorEvent && dontPreventDefault && !m_requestAborted) {
m_transaction->setError(m_error);
- m_transaction->abort();
+ ExceptionCode unused;
+ m_transaction->abort(unused);
}
if (event->type() != eventNames().blockedEvent)
@@ -475,7 +476,8 @@
{
if (m_transaction && !m_requestAborted) {
m_transaction->setError(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::IDB_ABORT_ERR)));
- m_transaction->abort();
+ ExceptionCode unused;
+ m_transaction->abort(unused);
}
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (123697 => 123698)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2012-07-26 02:30:34 UTC (rev 123698)
@@ -193,10 +193,13 @@
m_backend->commit();
}
-void IDBTransaction::abort()
+void IDBTransaction::abort(ExceptionCode& ec)
{
- if (m_state == Finishing || m_state == Finished)
+ if (m_state == Finishing || m_state == Finished) {
+ ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
return;
+ }
+
m_state = Finishing;
m_active = false;
@@ -387,7 +390,8 @@
ActiveDOMObject::stop();
m_contextStopped = true;
- abort();
+ ExceptionCode unused;
+ abort(unused);
}
void IDBTransaction::enqueueEvent(PassRefPtr<Event> event)
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (123697 => 123698)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h 2012-07-26 02:30:34 UTC (rev 123698)
@@ -78,7 +78,7 @@
IDBDatabase* db() const { return m_database.get(); }
PassRefPtr<DOMError> error() const { return m_error; }
PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&);
- void abort();
+ void abort(ExceptionCode&);
class OpenCursorNotifier {
public:
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl (123697 => 123698)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl 2012-07-26 02:28:17 UTC (rev 123697)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl 2012-07-26 02:30:34 UTC (rev 123698)
@@ -44,7 +44,8 @@
// Methods
IDBObjectStore objectStore (in DOMString name)
raises (IDBDatabaseException);
- void abort ();
+ void abort ()
+ raises (IDBDatabaseException);
// Events
attribute EventListener onabort;