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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/location.h" 5 #include "base/location.h"
6 #include "base/single_thread_task_runner.h" 6 #include "base/single_thread_task_runner.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "chrome/browser/extensions/activity_log/activity_log.h" 9 #include "chrome/browser/extensions/activity_log/activity_log.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 24 matching lines...) Expand all
35 command_line->AppendSwitchASCII(switches::kPrerenderMode, 35 command_line->AppendSwitchASCII(switches::kPrerenderMode,
36 switches::kPrerenderModeSwitchValueEnabled); 36 switches::kPrerenderModeSwitchValueEnabled);
37 } 37 }
38 38
39 static void Prerender_Arguments( 39 static void Prerender_Arguments(
40 const std::string& extension_id, 40 const std::string& extension_id,
41 uint16 port, 41 uint16 port,
42 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { 42 scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
43 // This is to exit RunLoop (base::MessageLoop::current()->Run()) below 43 // This is to exit RunLoop (base::MessageLoop::current()->Run()) below
44 base::ThreadTaskRunnerHandle::Get()->PostTask( 44 base::ThreadTaskRunnerHandle::Get()->PostTask(
45 FROM_HERE, base::MessageLoop::QuitClosure()); 45 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
46 46
47 ASSERT_TRUE(i->size()); 47 ASSERT_TRUE(i->size());
48 scoped_refptr<Action> last = i->front(); 48 scoped_refptr<Action> last = i->front();
49 49
50 ASSERT_EQ(extension_id, last->extension_id()); 50 ASSERT_EQ(extension_id, last->extension_id());
51 ASSERT_EQ(Action::ACTION_CONTENT_SCRIPT, last->action_type()); 51 ASSERT_EQ(Action::ACTION_CONTENT_SCRIPT, last->action_type());
52 ASSERT_EQ("[\"/google_cs.js\"]", 52 ASSERT_EQ("[\"/google_cs.js\"]",
53 ActivityLogPolicy::Util::Serialize(last->args())); 53 ActivityLogPolicy::Util::Serialize(last->args()));
54 ASSERT_EQ( 54 ASSERT_EQ(
55 base::StringPrintf("http://www.google.com.bo:%u/test.html", port), 55 base::StringPrintf("http://www.google.com.bo:%u/test.html", port),
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 "", 119 "",
120 -1, 120 -1,
121 base::Bind( 121 base::Bind(
122 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port)); 122 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port));
123 123
124 // Allow invocation of Prerender_Arguments 124 // Allow invocation of Prerender_Arguments
125 base::MessageLoop::current()->Run(); 125 base::MessageLoop::current()->Run();
126 } 126 }
127 127
128 } // namespace extensions 128 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/save_page_browsertest.cc ('k') | chrome/browser/extensions/activity_log/counting_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698