Status

()

Toolkit
Storage
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: mak, Assigned: mak)

Tracking

unspecified
mozilla6
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-places])

Attachments

(1 attachment, 1 obsolete attachment)

+++ This bug was initially created as a clone of Bug #637957 +++

Splitting the test from the bug, to allow the fix to land, the test still needs a better review and some polish once Shawn is back, we can land it in RC phase as well.

Will attach a new patch shortly.
Created attachment 516310 [details] [diff] [review]
patch v1.0
Attachment #516310 - Flags: review?(sdwilsh)
Comment on attachment 516310 [details] [diff] [review]
patch v1.0

>+++ b/storage/test/test_async_callbacks_with_spun_event_loops.cpp
>+void
>+test_SpinEventsLoopInHandleResult()
>+{
>+  nsCOMPtr<mozIStorageConnection> db(getMemoryDatabase());
>+
>+  // Create a test table and populate it.
>+  nsCOMPtr<mozIStorageAsyncStatement> stmt;
>+  db->CreateAsyncStatement(NS_LITERAL_CSTRING(
>+    "CREATE TABLE test (id INTEGER PRIMARY KEY)"
>+  ), getter_AddRefs(stmt));
>+  blocking_async_execute(stmt);
>+  stmt->Finalize();
>+
>+  db->CreateAsyncStatement(NS_LITERAL_CSTRING(
>+    "INSERT INTO test (id) VALUES (?)"
>+  ), getter_AddRefs(stmt));
>+  for (PRInt32 i = 0; i < 30; ++i) {
>+    stmt->BindInt32Parameter(0, i);
>+    blocking_async_execute(stmt);
>+  }
>+  stmt->Finalize();
Just do these synchronously so we don't add more variables to the test.

>+void
>+test_SpinEventsLoopInHandleError()
>+{
>+  nsCOMPtr<mozIStorageConnection> db(getMemoryDatabase());
>+
>+  // Create a test table and populate it.
>+  nsCOMPtr<mozIStorageAsyncStatement> stmt;
>+  db->CreateAsyncStatement(NS_LITERAL_CSTRING(
>+    "CREATE TABLE test (id INTEGER PRIMARY KEY)"
>+  ), getter_AddRefs(stmt));
>+  blocking_async_execute(stmt);
>+  stmt->Finalize();
>+
>+  db->CreateAsyncStatement(NS_LITERAL_CSTRING(
>+    "INSERT INTO test (id) VALUES (1)"
>+  ), getter_AddRefs(stmt));
>+  blocking_async_execute(stmt);
>+  stmt->Finalize();
ditto

r=sdwilsh
Attachment #516310 - Flags: review?(sdwilsh) → review+
Created attachment 528849 [details] [diff] [review]
patch v1.1

addressed comments.
Attachment #516310 - Attachment is obsolete: true
http://hg.mozilla.org/projects/places/rev/18d8734519e7
Flags: in-testsuite+
Whiteboard: [fixed-in-places]
followup to remove a trailing semicolon that was causing the build to fail on Linux.
http://hg.mozilla.org/projects/places/rev/5f97ac170bfa
http://hg.mozilla.org/mozilla-central/rev/18d8734519e7
http://hg.mozilla.org/mozilla-central/rev/5f97ac170bfa
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.