Index: net/ssl/server_bound_cert_service_unittest.cc |
diff --git a/net/ssl/server_bound_cert_service_unittest.cc b/net/ssl/server_bound_cert_service_unittest.cc |
index 0063f496036854c4c3a1ae2be4cbc1dea394ae66..84a2f67905ed1ba77a7c6a60838ea1457e28956f 100644 |
--- a/net/ssl/server_bound_cert_service_unittest.cc |
+++ b/net/ssl/server_bound_cert_service_unittest.cc |
@@ -529,6 +529,12 @@ TEST_F(ServerBoundCertServiceTest, AsyncStoreGetNoCertsInStore) { |
mock_store->CallGetServerBoundCertCallbackWithResult( |
ERR_FILE_NOT_FOUND, base::Time(), std::string(), std::string()); |
+ // Wait for any posted ServerBoundCertServiceWorkers to finish. |
+ // (By calling CallGetServerBoundCertCallbackWithResult, callbacks are |
+ // called directly, short-circuiting ServerBoundCertService's usual |
+ // bookkeeping.) |
+ sequenced_worker_pool_->FlushForTesting(); |
+ base::MessageLoop::current()->RunUntilIdle(); |
Ryan Sleevi
2013/08/08 23:18:46
Consider updating the comments to be more descript
juanlang
2013/08/08 23:51:08
Done, I think. The rationale is different, and unl
|
error = callback.WaitForResult(); |
EXPECT_EQ(OK, error); |
@@ -560,6 +566,12 @@ TEST_F(ServerBoundCertServiceTest, AsyncStoreGetOneCertInStore) { |
mock_store->CallGetServerBoundCertCallbackWithResult( |
OK, base::Time(), "ab", "cd"); |
+ // Wait for any posted ServerBoundCertServiceWorkers to finish. |
+ // (By calling CallGetServerBoundCertCallbackWithResult, callbacks are |
+ // called directly, short-circuiting ServerBoundCertService's usual |
+ // bookkeeping.) |
+ sequenced_worker_pool_->FlushForTesting(); |
+ base::MessageLoop::current()->RunUntilIdle(); |
error = callback.WaitForResult(); |
EXPECT_EQ(OK, error); |