Fix stack splat in MessagePumpMacTest

If IncrementInModeAndExpect posted a task it didn't expect to run
within the CFRunLoopRunInMode that task would still run and splat
something on the stack. Due to luck this doesn't matter with the
MessageLoop but it causes crashes with the SequenceManager.

This patch fixes it by introducing a weak pointer in the test
task to make sure it doesn't run when it shouldn't.

Bug: 891670
Change-Id: I175903d977ee92adb2aee9461dce209dd387510a
Reviewed-on: https://chromium-review.googlesource.com/c/1403414
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621560}
5 files changed