Index: chrome/browser/sync/test/integration/printers_helper.cc |
diff --git a/chrome/browser/sync/test/integration/printers_helper.cc b/chrome/browser/sync/test/integration/printers_helper.cc |
index 084e1d02ae2293e88a6eed2792136d7bf88200b0..adc0c66a04b4b98120278a0550076c02323cf683 100644 |
--- a/chrome/browser/sync/test/integration/printers_helper.cc |
+++ b/chrome/browser/sync/test/integration/printers_helper.cc |
@@ -13,10 +13,12 @@ |
#include "base/memory/ptr_util.h" |
#include "base/run_loop.h" |
#include "base/strings/stringprintf.h" |
+#include "base/threading/sequenced_worker_pool.h" |
#include "chrome/browser/chromeos/printing/printers_manager.h" |
#include "chrome/browser/chromeos/printing/printers_manager_factory.h" |
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
#include "chrome/browser/sync/test/integration/sync_test.h" |
+#include "content/public/browser/browser_thread.h" |
using sync_datatype_helper::test; |
@@ -110,6 +112,9 @@ chromeos::PrintersManager* GetVerifierPrinterStore() { |
chromeos::PrintersManagerFactory::GetForBrowserContext( |
sync_datatype_helper::test()->verifier()); |
// Must wait for ModelTypeStore initialization. |
+ // Flush here since PrintersManagerFactory::BuildServiceInstanceFor() uses |
skym
2017/04/06 16:48:44
Can you expand on this comment. Why are we flushin
Gang Wu
2017/04/06 19:22:59
Done.
|
+ // content::BrowserThread::GetBlockingPool(). |
+ content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
skym
2017/04/06 16:48:44
I don't like how this is being done. Do we really
Gang Wu
2017/04/06 19:22:59
Done.
|
base::RunLoop().RunUntilIdle(); |
return manager; |
@@ -120,6 +125,9 @@ chromeos::PrintersManager* GetPrinterStore(int index) { |
chromeos::PrintersManagerFactory::GetForBrowserContext( |
sync_datatype_helper::test()->GetProfile(index)); |
// Must wait for ModelTypeStore initialization. |
+ // Flush here since PrintersManagerFactory::BuildServiceInstanceFor() uses |
+ // content::BrowserThread::GetBlockingPool(). |
+ content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
base::RunLoop().RunUntilIdle(); |
return manager; |