Add unit tests for -deliverOnMainThread