From cfa68bef6d04647e92ca33ef0eceb3bb10571a86 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Sun, 26 Aug 2012 21:28:10 -0700 Subject: [PATCH 1/2] Bug 784404 - Intermittent assertion in dom/devicestorage/test/test_basic.html. r=bent --- dom/devicestorage/DeviceStorageRequestParent.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dom/devicestorage/DeviceStorageRequestParent.h b/dom/devicestorage/DeviceStorageRequestParent.h index 843124473ec..0c5b024e9ee 100644 --- a/dom/devicestorage/DeviceStorageRequestParent.h +++ b/dom/devicestorage/DeviceStorageRequestParent.h @@ -49,11 +49,17 @@ private: nsresult rv = NS_OK; if (!mCanceled) { rv = CancelableRun(); - mParent->RemoveRunnable(this); + + nsCOMPtr event = NS_NewRunnableMethod(this, &CancelableRunnable::RemoveRunnable); + NS_DispatchToMainThread(event); } return rv; } + void RemoveRunnable() { + mParent->RemoveRunnable(this); + } + void Cancel() { mCanceled = true; } @@ -184,9 +190,11 @@ private: protected: void AddRunnable(CancelableRunnable* aRunnable) { + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); mRunnables.AppendElement(aRunnable); } void RemoveRunnable(CancelableRunnable* aRunnable) { + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); mRunnables.RemoveElement(aRunnable); } nsTArray > mRunnables; From 6d18104c24ad061cbdebe173f8fabaff4b9d3bd7 Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Mon, 27 Aug 2012 09:34:23 -0700 Subject: [PATCH 2/2] Bug 785273 - Fix MarionetteJS case breakage, a=test-only, DONTBUILD because NPOTB --- testing/marionette/client/marionette/marionette_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testing/marionette/client/marionette/marionette_test.py b/testing/marionette/client/marionette/marionette_test.py index 83829b755a3..e76bea2e406 100644 --- a/testing/marionette/client/marionette/marionette_test.py +++ b/testing/marionette/client/marionette/marionette_test.py @@ -117,10 +117,11 @@ class MarionetteJSTestCase(CommonTestCase): timeout_re = re.compile(r"MARIONETTE_TIMEOUT(\s*)=(\s*)(\d+);") launch_re = re.compile(r"MARIONETTE_LAUNCH_APP(\s*)=(\s*)['|\"](.*?)['|\"];") - def __init__(self, marionette, methodName='runTest', jsFile=None): + def __init__(self, marionette_weakref, methodName='runTest', jsFile=None): assert(jsFile) self.jsFile = jsFile - self.marionette = marionette + self._marionette_weakref = marionette_weakref + self.marionette = None CommonTestCase.__init__(self, methodName) def runTest(self):