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

Unified Diff: chrome/browser/chromeos/policy/device_status_collector_browsertest.cc

Issue 2767923002: Always use an async TaskScheduler in TestBrowserThreadBundle. (Closed)
Patch Set: fix-test-error Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
diff --git a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
index 2e99b27c7eedecbe09a39936dad5b8b0f3f19b9c..276c6365e2ed8467994c2a7543bbcc477ca2a091 100644
--- a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
@@ -154,7 +154,7 @@ class TestingDeviceStatusCollector : public policy::DeviceStatusCollector {
void RefreshSampleResourceUsage() {
SampleResourceUsage();
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
+ content::RunAllBlockingPoolTasksUntilIdle();
}
protected:
@@ -360,8 +360,7 @@ class DeviceStatusCollectorTest : public testing::Test {
TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr);
// Finish pending tasks.
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- base::RunLoop().RunUntilIdle();
+ content::RunAllBlockingPoolTasksUntilIdle();
storage::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems();
DiskMountManager::Shutdown();
}
@@ -903,8 +902,7 @@ TEST_F(DeviceStatusCollectorTest, TestVolumeInfo) {
base::Bind(&GetEmptyCPUTempInfo),
base::Bind(&GetEmptyAndroidStatus));
// Force finishing tasks posted by ctor of DeviceStatusCollector.
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- base::RunLoop().RunUntilIdle();
+ content::RunAllBlockingPoolTasksUntilIdle();
GetStatus();
EXPECT_EQ(expected_mount_points.size(),
@@ -957,8 +955,7 @@ TEST_F(DeviceStatusCollectorTest, TestCPUSamples) {
base::Bind(&GetEmptyCPUTempInfo),
base::Bind(&GetEmptyAndroidStatus));
// Force finishing tasks posted by ctor of DeviceStatusCollector.
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- base::RunLoop().RunUntilIdle();
+ content::RunAllBlockingPoolTasksUntilIdle();
GetStatus();
ASSERT_EQ(1, device_status_.cpu_utilization_pct().size());
EXPECT_EQ(100, device_status_.cpu_utilization_pct(0));
@@ -1009,8 +1006,7 @@ TEST_F(DeviceStatusCollectorTest, TestCPUTemp) {
base::Bind(&GetFakeCPUTempInfo, expected_temp_info),
base::Bind(&GetEmptyAndroidStatus));
// Force finishing tasks posted by ctor of DeviceStatusCollector.
- content::BrowserThread::GetBlockingPool()->FlushForTesting();
- base::RunLoop().RunUntilIdle();
+ content::RunAllBlockingPoolTasksUntilIdle();
GetStatus();
EXPECT_EQ(expected_temp_info.size(),
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698