This commit is contained in:
Ryan VanderMeulen 2012-08-27 12:51:10 -04:00
Родитель 589054623a 347cc960fa
Коммит 4b018119c7
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -49,11 +49,17 @@ private:
nsresult rv = NS_OK;
if (!mCanceled) {
rv = CancelableRun();
mParent->RemoveRunnable(this);
nsCOMPtr<nsIRunnable> 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<nsRefPtr<CancelableRunnable> > mRunnables;

Просмотреть файл

@ -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):