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

Unified Diff: chrome/browser/extensions/crx_installer_browsertest.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/extensions/crx_installer_browsertest.cc
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc
index 3bef3d6ada0a9620c23d489d7a38f6b01a43becc..b38c6b07e3463e88372fdfeca518da7943f48c83 100644
--- a/chrome/browser/extensions/crx_installer_browsertest.cc
+++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/extensions/crx_installer.h"
+
#include "base/at_exit.h"
#include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/extensions/browser_action_test_util.h"
-#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -24,6 +25,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/download_test_observer.h"
+#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
@@ -524,14 +526,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) {
browser()->profile())->extension_service();
EXPECT_FALSE(service->GetExtensionById(extension_id, false));
- // In the worst case you need to repeat this up to 3 times to make sure that
- // all pending tasks we sent from UI thread to task runner and back to UI.
- for (int i = 0; i < 3; i++) {
- // Wait for background task completion that sends replay to UI thread.
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- // Wait for UI thread task completion.
- base::RunLoop().RunUntilIdle();
- }
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_FALSE(base::PathExists(extension_path));
}

Powered by Google App Engine
This is Rietveld 408576698