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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1159623009: content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/shell/renderer/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <clocale> 8 #include <clocale>
9 #include <cmath> 9 #include <cmath>
10 10
11 #include "base/base64.h" 11 #include "base/base64.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/debug/debugger.h" 14 #include "base/debug/debugger.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/location.h"
16 #include "base/md5.h" 17 #include "base/md5.h"
17 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
18 #include "base/message_loop/message_loop.h" 19 #include "base/single_thread_task_runner.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/strings/sys_string_conversions.h" 22 #include "base/strings/sys_string_conversions.h"
22 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "base/thread_task_runner_handle.h"
23 #include "base/time/time.h" 25 #include "base/time/time.h"
24 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
25 #include "content/public/common/url_constants.h" 27 #include "content/public/common/url_constants.h"
26 #include "content/public/common/web_preferences.h" 28 #include "content/public/common/web_preferences.h"
27 #include "content/public/renderer/render_frame.h" 29 #include "content/public/renderer/render_frame.h"
28 #include "content/public/renderer/render_view.h" 30 #include "content/public/renderer/render_view.h"
29 #include "content/public/renderer/render_view_visitor.h" 31 #include "content/public/renderer/render_view_visitor.h"
30 #include "content/public/renderer/renderer_gamepad_provider.h" 32 #include "content/public/renderer/renderer_gamepad_provider.h"
31 #include "content/public/test/layouttest_support.h" 33 #include "content/public/test/layouttest_support.h"
32 #include "content/shell/common/layout_test/layout_test_messages.h" 34 #include "content/shell/common/layout_test/layout_test_messages.h"
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 Send(new ShellViewHostMsg_ImageDump( 814 Send(new ShellViewHostMsg_ImageDump(
813 routing_id(), actual_pixel_hash, snapshot)); 815 routing_id(), actual_pixel_hash, snapshot));
814 } 816 }
815 817
816 CaptureDumpComplete(); 818 CaptureDumpComplete();
817 } 819 }
818 820
819 void BlinkTestRunner::CaptureDumpComplete() { 821 void BlinkTestRunner::CaptureDumpComplete() {
820 render_view()->GetWebView()->mainFrame()->stopLoading(); 822 render_view()->GetWebView()->mainFrame()->stopLoading();
821 823
822 base::MessageLoop::current()->PostTask( 824 base::ThreadTaskRunnerHandle::Get()->PostTask(
823 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send), 825 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send),
824 base::Unretained(this), 826 base::Unretained(this),
825 new ShellViewHostMsg_TestFinished(routing_id()))); 827 new ShellViewHostMsg_TestFinished(routing_id())));
826 } 828 }
827 829
828 void BlinkTestRunner::OnSetTestConfiguration( 830 void BlinkTestRunner::OnSetTestConfiguration(
829 const ShellTestConfiguration& params) { 831 const ShellTestConfiguration& params) {
830 test_config_ = params; 832 test_config_ = params;
831 is_main_window_ = true; 833 is_main_window_ = true;
832 834
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 877
876 leak_detector_->TryLeakDetection(main_frame); 878 leak_detector_->TryLeakDetection(main_frame);
877 } 879 }
878 880
879 void BlinkTestRunner::ReportLeakDetectionResult( 881 void BlinkTestRunner::ReportLeakDetectionResult(
880 const LeakDetectionResult& report) { 882 const LeakDetectionResult& report) {
881 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 883 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
882 } 884 }
883 885
884 } // namespace content 886 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698