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

Side by Side Diff: content/shell/renderer/test_runner/web_test_proxy.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test_runner/web_test_proxy.h" 5 #include "content/shell/renderer/test_runner/web_test_proxy.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/single_thread_task_runner.h"
12 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "base/thread_task_runner_handle.h"
15 #include "base/trace_event/trace_event.h" 18 #include "base/trace_event/trace_event.h"
16 #include "content/shell/renderer/test_runner/accessibility_controller.h" 19 #include "content/shell/renderer/test_runner/accessibility_controller.h"
17 #include "content/shell/renderer/test_runner/event_sender.h" 20 #include "content/shell/renderer/test_runner/event_sender.h"
18 #include "content/shell/renderer/test_runner/mock_color_chooser.h" 21 #include "content/shell/renderer/test_runner/mock_color_chooser.h"
19 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" 22 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
20 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 23 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
21 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
22 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" 25 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h"
23 #include "content/shell/renderer/test_runner/spell_check_client.h" 26 #include "content/shell/renderer/test_runner/spell_check_client.h"
24 #include "content/shell/renderer/test_runner/test_interfaces.h" 27 #include "content/shell/renderer/test_runner/test_interfaces.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 615 }
613 callback.Run(bitmap); 616 callback.Run(bitmap);
614 return; 617 return;
615 } 618 }
616 619
617 callback.Run(drag_image_.getSkBitmap()); 620 callback.Run(drag_image_.getSkBitmap());
618 return; 621 return;
619 } 622 }
620 623
621 if (test_interfaces_->GetTestRunner()->isPrinting()) { 624 if (test_interfaces_->GetTestRunner()->isPrinting()) {
622 base::MessageLoopProxy::current()->PostTask( 625 base::ThreadTaskRunnerHandle::Get()->PostTask(
623 FROM_HERE, 626 FROM_HERE, base::Bind(&WebTestProxyBase::CapturePixelsForPrinting,
624 base::Bind(&WebTestProxyBase::CapturePixelsForPrinting, 627 base::Unretained(this), callback));
625 base::Unretained(this),
626 callback));
627 return; 628 return;
628 } 629 }
629 630
630 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( 631 CaptureCallback* capture_callback = new CaptureCallback(base::Bind(
631 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), 632 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this),
632 callback)); 633 callback));
633 web_widget_->compositeAndReadbackAsync(capture_callback); 634 web_widget_->compositeAndReadbackAsync(capture_callback);
634 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { 635 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) {
635 capture_callback->set_wait_for_popup(true); 636 capture_callback->set_wait_for_popup(true);
636 capture_callback->set_popup_position(popup->positionRelativeToOwner()); 637 capture_callback->set_popup_position(popup->positionRelativeToOwner());
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 // to cancel the input method's ongoing composition session. 1394 // to cancel the input method's ongoing composition session.
1394 if (web_widget_) 1395 if (web_widget_)
1395 web_widget_->confirmComposition(); 1396 web_widget_->confirmComposition();
1396 } 1397 }
1397 1398
1398 blink::WebString WebTestProxyBase::acceptLanguages() { 1399 blink::WebString WebTestProxyBase::acceptLanguages() {
1399 return blink::WebString::fromUTF8(accept_languages_); 1400 return blink::WebString::fromUTF8(accept_languages_);
1400 } 1401 }
1401 1402
1402 } // namespace content 1403 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698