Index: chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
diff --git a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
index d6b413137975e04c83f86a4f90ac6a872c1c33cf..08897ab2d740dfbb65eea0dfbc9a5bf262f04591 100644 |
--- a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
+++ b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
@@ -26,6 +26,7 @@ |
#include "base/values.h" |
#include "build/build_config.h" |
#include "chrome/browser/extensions/activity_log/activity_log.h" |
+#include "chrome/browser/extensions/activity_log/activity_log_task_runner.h" |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/test_extension_system.h" |
#include "chrome/common/chrome_constants.h" |
@@ -43,8 +44,6 @@ |
#include "chrome/browser/chromeos/settings/device_settings_service.h" |
#endif |
-using content::BrowserThread; |
- |
namespace extensions { |
class CountingPolicyTest : public testing::Test { |
@@ -72,10 +71,10 @@ class CountingPolicyTest : public testing::Test { |
base::RunLoop().RunUntilIdle(); |
} |
- // Wait for the task queue for the specified thread to empty. |
- void WaitOnThread(const BrowserThread::ID& thread) { |
- BrowserThread::PostTaskAndReply( |
- thread, FROM_HERE, base::BindOnce(&base::DoNothing), |
+ // Waits for the task queue for the activity log sequence to empty. |
+ void WaitOnActivityLogSequence() { |
+ GetActivityLogTaskRunner()->PostTaskAndReply( |
+ FROM_HERE, base::BindOnce(&base::DoNothing), |
base::MessageLoop::current()->QuitWhenIdleClosure()); |
gab
2017/07/27 18:34:53
While you're here, this is a deprecated paradigm,
Devlin
2017/07/28 14:41:12
Sure, done.
|
base::RunLoop().Run(); |
} |
@@ -773,7 +772,7 @@ TEST_F(CountingPolicyTest, StringTableCleaning) { |
&CountingPolicyTest::CheckStringTableSizes, |
3, |
1); |
- WaitOnThread(BrowserThread::DB); |
+ WaitOnActivityLogSequence(); |
// Trigger a cleaning. The oldest action is expired when we submit a |
// duplicate of the newer action. After this, there should be two strings |
@@ -786,7 +785,7 @@ TEST_F(CountingPolicyTest, StringTableCleaning) { |
&CountingPolicyTest::CheckStringTableSizes, |
2, |
0); |
- WaitOnThread(BrowserThread::DB); |
+ WaitOnActivityLogSequence(); |
policy->Close(); |
} |
@@ -884,7 +883,7 @@ TEST_F(CountingPolicyTest, EarlyFlush) { |
} |
policy->ScheduleAndForget(policy, &CountingPolicyTest::CheckQueueSize); |
- WaitOnThread(BrowserThread::DB); |
+ WaitOnActivityLogSequence(); |
policy->Close(); |
} |
@@ -903,7 +902,7 @@ TEST_F(CountingPolicyTest, CapReturns) { |
} |
policy->Flush(); |
- WaitOnThread(BrowserThread::DB); |
+ WaitOnActivityLogSequence(); |
CheckReadFilteredData( |
policy, |