OLD | NEW |
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 "components/test_runner/web_test_proxy.h" | 5 #include "components/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/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/thread_task_runner_handle.h" |
15 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
16 #include "components/test_runner/accessibility_controller.h" | 17 #include "components/test_runner/accessibility_controller.h" |
17 #include "components/test_runner/event_sender.h" | 18 #include "components/test_runner/event_sender.h" |
18 #include "components/test_runner/mock_color_chooser.h" | 19 #include "components/test_runner/mock_color_chooser.h" |
19 #include "components/test_runner/mock_credential_manager_client.h" | 20 #include "components/test_runner/mock_credential_manager_client.h" |
20 #include "components/test_runner/mock_screen_orientation_client.h" | 21 #include "components/test_runner/mock_screen_orientation_client.h" |
21 #include "components/test_runner/mock_web_speech_recognizer.h" | 22 #include "components/test_runner/mock_web_speech_recognizer.h" |
22 #include "components/test_runner/mock_web_user_media_client.h" | 23 #include "components/test_runner/mock_web_user_media_client.h" |
23 #include "components/test_runner/spell_check_client.h" | 24 #include "components/test_runner/spell_check_client.h" |
24 #include "components/test_runner/test_interfaces.h" | 25 #include "components/test_runner/test_interfaces.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 623 } |
623 callback.Run(bitmap); | 624 callback.Run(bitmap); |
624 return; | 625 return; |
625 } | 626 } |
626 | 627 |
627 callback.Run(drag_image_.getSkBitmap()); | 628 callback.Run(drag_image_.getSkBitmap()); |
628 return; | 629 return; |
629 } | 630 } |
630 | 631 |
631 if (test_interfaces_->GetTestRunner()->isPrinting()) { | 632 if (test_interfaces_->GetTestRunner()->isPrinting()) { |
632 base::MessageLoopProxy::current()->PostTask( | 633 base::ThreadTaskRunnerHandle::Get()->PostTask( |
633 FROM_HERE, | 634 FROM_HERE, base::Bind(&WebTestProxyBase::CapturePixelsForPrinting, |
634 base::Bind(&WebTestProxyBase::CapturePixelsForPrinting, | 635 base::Unretained(this), callback)); |
635 base::Unretained(this), | |
636 callback)); | |
637 return; | 636 return; |
638 } | 637 } |
639 | 638 |
640 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( | 639 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( |
641 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), | 640 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), |
642 callback)); | 641 callback)); |
643 web_widget_->compositeAndReadbackAsync(capture_callback); | 642 web_widget_->compositeAndReadbackAsync(capture_callback); |
644 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { | 643 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { |
645 capture_callback->set_wait_for_popup(true); | 644 capture_callback->set_wait_for_popup(true); |
646 capture_callback->set_popup_position(popup->positionRelativeToOwner()); | 645 capture_callback->set_popup_position(popup->positionRelativeToOwner()); |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 // to cancel the input method's ongoing composition session. | 1396 // to cancel the input method's ongoing composition session. |
1398 if (web_widget_) | 1397 if (web_widget_) |
1399 web_widget_->confirmComposition(); | 1398 web_widget_->confirmComposition(); |
1400 } | 1399 } |
1401 | 1400 |
1402 blink::WebString WebTestProxyBase::acceptLanguages() { | 1401 blink::WebString WebTestProxyBase::acceptLanguages() { |
1403 return blink::WebString::fromUTF8(accept_languages_); | 1402 return blink::WebString::fromUTF8(accept_languages_); |
1404 } | 1403 } |
1405 | 1404 |
1406 } // namespace test_runner | 1405 } // namespace test_runner |
OLD | NEW |