Bug 1365517 - Remove the call to AbstractThread::GetCurrent() in TestAsyncReturns.cpp.
See
bug 1365483 for the rationale.
MozReview-Commit-ID: AGFtjTzRqvC
--- a/ipc/ipdl/test/cxx/TestAsyncReturns.cpp
+++ b/ipc/ipdl/test/cxx/TestAsyncReturns.cpp
@@ -21,32 +21,32 @@ TestAsyncReturnsParent::TestAsyncReturns
TestAsyncReturnsParent::~TestAsyncReturnsParent()
{
MOZ_COUNT_DTOR(TestAsyncReturnsParent);
}
void
TestAsyncReturnsParent::Main()
{
- if (!AbstractThread::GetCurrent()) {
+ if (!AbstractThread::MainThread()) {
fail("AbstractThread not initalized");
}
- SendNoReturn()->Then(AbstractThread::GetCurrent(), __func__,
+ SendNoReturn()->Then(AbstractThread::MainThread(), __func__,
[](bool unused) {
fail("resolve handler should not be called");
},
[](PromiseRejectReason aReason) {
// MozPromise asserts in debug build if the
// handler is not called
if (aReason != PromiseRejectReason::ChannelClosed) {
fail("reject with wrong reason");
}
passed("reject handler called on channel close");
});
- SendPing()->Then(AbstractThread::GetCurrent(), __func__,
+ SendPing()->Then(AbstractThread::MainThread(), __func__,
[this](bool one) {
if (one) {
passed("take one argument");
} else {
fail("get one argument but has wrong value");
}
Close();
},
@@ -83,20 +83,20 @@ TestAsyncReturnsChild::RecvNoReturn(RefP
// Leak the promise intentionally
Unused << do_AddRef(aPromise);
return IPC_OK();
}
mozilla::ipc::IPCResult
TestAsyncReturnsChild::RecvPing(RefPtr<PingPromise>&& aPromise)
{
- if (!AbstractThread::GetCurrent()) {
+ if (!AbstractThread::MainThread()) {
fail("AbstractThread not initalized");
}
- SendPong()->Then(AbstractThread::GetCurrent(), __func__,
+ SendPong()->Then(AbstractThread::MainThread(), __func__,
[aPromise](const Tuple<uint32_t, uint32_t>& aParam) {
if (Get<0>(aParam) == sMagic1 && Get<1>(aParam) == sMagic2) {
passed("take two arguments");
} else {
fail("get two argument but has wrong value");
}
aPromise->Resolve(true, __func__);
},