Bug 1339924 - Remove unneeded [queue] lambda capture - r?dholbert
'queue' is not used inside that lambda, so we can drop it.
Another option would have been to simulate its use through `Unused <<`.
But I think that it's a useful test, *not* to capture the queue here, to verify
that it is correctly captured in the enclosing MozPromise::Then.
MozReview-Commit-ID: LUQGPJzDcTb
--- a/dom/media/gtest/TestMozPromise.cpp
+++ b/dom/media/gtest/TestMozPromise.cpp
@@ -190,17 +190,17 @@ TEST(MozPromise, CompletionPromises)
[queue] (int aVal) -> RefPtr<TestPromise> {
RefPtr<TestPromise::Private> p = new TestPromise::Private(__func__);
nsCOMPtr<nsIRunnable> resolver = new DelayedResolveOrReject(queue, p, RRValue::MakeResolve(aVal - 8), 10);
queue->Dispatch(resolver.forget());
return RefPtr<TestPromise>(p);
},
DO_FAIL)
->Then(queue, __func__,
- [queue] (int aVal) -> RefPtr<TestPromise> { return TestPromise::CreateAndReject(double(aVal - 42) + 42.0, __func__); },
+ [] (int aVal) -> RefPtr<TestPromise> { return TestPromise::CreateAndReject(double(aVal - 42) + 42.0, __func__); },
DO_FAIL)
->Then(queue, __func__,
DO_FAIL,
[queue, &invokedPass] (double aVal) -> void { EXPECT_EQ(aVal, 42.0); EXPECT_TRUE(invokedPass); queue->BeginShutdown(); });
});
}
TEST(MozPromise, PromiseAllResolve)