Add an option to goog.testing.TestCase to allow using native Promises. This helps tests that have very subtle behavior when tests/setUps methods return Promises in conjunction with MockClock.
Add an option to goog.testing.TestCase to allow using native Promises. This helps tests that have very subtle behavior when tests/setUps methods return Promises in conjunction with MockClock.

There are a number of cases where installing a MockClock when there is work in the async work queue breaks the MockClock's expectation and causes it to hang indefinitely or for tick() to have no effect. This happens specifically when there is work in the goog.async.run work queue that was added while goog.async.run was being supported by a native Promise implementation.

By using native Promises in the testcase, we are guaranteed that native Promises returned by setUp/test/tearDown will at least have a chance of running, because the test itself is using native Promises, and moves a lot of async work out of goog.async.run, where it has a chance of blocking the queue.

This also makes test easier to debug, since it removes a lot the indirection in stack traces.
RELNOTES: n/a
PiperOrigin-RevId: 426473099
Change-Id: I3f711ee6db62a8abbf25a36098322f72be905acc

google/closure-library,google/closure-library,google/closure-library,google/closure-library,google/closure-library