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

Unified Diff: chrome/browser/extensions/activity_log/activity_log_browsertest.cc

Issue 2315443004: Remove calls to deprecated MessageLoop methods in chrome. (Closed)
Patch Set: fix build error Created 4 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/activity_log/activity_log_browsertest.cc
diff --git a/chrome/browser/extensions/activity_log/activity_log_browsertest.cc b/chrome/browser/extensions/activity_log/activity_log_browsertest.cc
index 43664e4d6d39a44b0715c407e44148e084777d9e..1008a8a28c690cd8517c78974e7c87be717a58f4 100644
--- a/chrome/browser/extensions/activity_log/activity_log_browsertest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_browsertest.cc
@@ -4,6 +4,7 @@
#include <stdint.h>
+#include "base/callback.h"
#include "base/location.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -42,10 +43,11 @@ class ActivityLogPrerenderTest : public ExtensionApiTest {
static void Prerender_Arguments(
const std::string& extension_id,
uint16_t port,
+ const base::Closure& quit_when_idle_closure,
std::unique_ptr<std::vector<scoped_refptr<Action>>> i) {
- // This is to exit RunLoop (base::MessageLoop::current()->Run()) below
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ // This is to exit RunLoop (run_loop.Run()) below
sky 2016/09/08 17:54:33 end sentence with '.'. That said, this comment isn
fdoray 2016/09/09 18:10:50 Actually, posting a QuitWhenIdleClosure() to the c
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ quit_when_idle_closure);
ASSERT_TRUE(i->size());
scoped_refptr<Action> last = i->front();
@@ -112,18 +114,14 @@ IN_PROC_BROWSER_TEST_F(ActivityLogPrerenderTest, TestScriptInjected) {
page_observer.Wait();
+ base::RunLoop run_loop;
activity_log->GetFilteredActions(
- ext->id(),
- Action::ACTION_ANY,
- "",
- "",
- "",
- -1,
- base::Bind(
- ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port));
+ ext->id(), Action::ACTION_ANY, "", "", "", -1,
+ base::Bind(ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port,
+ run_loop.QuitWhenIdleClosure()));
// Allow invocation of Prerender_Arguments
- base::RunLoop().Run();
+ run_loop.Run();
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698