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

Side by Side Diff: content/public/test/test_utils.cc

Issue 2082343002: Remove calls to deprecated MessageLoop methods in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Created 4 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/test_utils.h" 5 #include "content/public/test/test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 std::unique_ptr<base::Value> ExecuteScriptAndGetValue( 184 std::unique_ptr<base::Value> ExecuteScriptAndGetValue(
185 RenderFrameHost* render_frame_host, 185 RenderFrameHost* render_frame_host,
186 const std::string& script) { 186 const std::string& script) {
187 ScriptCallback observer; 187 ScriptCallback observer;
188 188
189 render_frame_host->ExecuteJavaScriptForTests( 189 render_frame_host->ExecuteJavaScriptForTests(
190 base::UTF8ToUTF16(script), 190 base::UTF8ToUTF16(script),
191 base::Bind(&ScriptCallback::ResultCallback, base::Unretained(&observer))); 191 base::Bind(&ScriptCallback::ResultCallback, base::Unretained(&observer)));
192 base::MessageLoop* loop = base::MessageLoop::current(); 192 base::RunLoop().Run();
193 loop->Run();
194 return observer.result(); 193 return observer.result();
195 } 194 }
196 195
197 bool AreAllSitesIsolatedForTesting() { 196 bool AreAllSitesIsolatedForTesting() {
198 return base::CommandLine::ForCurrentProcess()->HasSwitch( 197 return base::CommandLine::ForCurrentProcess()->HasSwitch(
199 switches::kSitePerProcess); 198 switches::kSitePerProcess);
200 } 199 }
201 200
202 void IsolateAllSitesForTesting(base::CommandLine* command_line) { 201 void IsolateAllSitesForTesting(base::CommandLine* command_line) {
203 command_line->AppendSwitch(switches::kSitePerProcess); 202 command_line->AppendSwitch(switches::kSitePerProcess);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 380
382 void WebContentsDestroyedWatcher::Wait() { 381 void WebContentsDestroyedWatcher::Wait() {
383 message_loop_runner_->Run(); 382 message_loop_runner_->Run();
384 } 383 }
385 384
386 void WebContentsDestroyedWatcher::WebContentsDestroyed() { 385 void WebContentsDestroyedWatcher::WebContentsDestroyed() {
387 message_loop_runner_->Quit(); 386 message_loop_runner_->Quit();
388 } 387 }
389 388
390 } // namespace content 389 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | content/renderer/device_sensors/device_light_event_pump_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698