Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: chrome/browser/sessions/persistent_tab_restore_service_unittest.cc

Issue 409743003: Use content::RunBlockingPoolTask() in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/persistent_tab_restore_service_unittest.cc
diff --git a/chrome/browser/sessions/persistent_tab_restore_service_unittest.cc b/chrome/browser/sessions/persistent_tab_restore_service_unittest.cc
index a715fcd9b0e99a4ec7e24782b528b6b214408714..89877e63b0cf5b7bb4b6f17ddfc8523a219ae5d7 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service_unittest.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service_unittest.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/sessions/persistent_tab_restore_service.h"
+#include <string>
+
#include "base/compiler_specific.h"
-#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -27,6 +28,7 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/render_view_test.h"
+#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -114,7 +116,7 @@ class PersistentTabRestoreServiceTest : public ChromeRenderViewHostTestHarness {
// Must set service to null first so that it is destroyed before the new
// one is created.
service_->Shutdown();
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
+ content::RunAllBlockingPoolTasksUntilIdle();
service_.reset();
service_.reset(new PersistentTabRestoreService(profile(), time_factory_));
SynchronousLoadTabsFromLastSession();
@@ -158,9 +160,7 @@ class PersistentTabRestoreServiceTest : public ChromeRenderViewHostTestHarness {
void SynchronousLoadTabsFromLastSession() {
// Ensures that the load is complete before continuing.
service_->LoadTabsFromLastSession();
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- base::RunLoop().RunUntilIdle();
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
+ content::RunAllBlockingPoolTasksUntilIdle();
}
GURL url1_;

Powered by Google App Engine
This is Rietveld 408576698