OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_frame_test_client.h" | 5 #include "components/test_runner/web_frame_test_client.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
10 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
11 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
12 #include "components/test_runner/accessibility_controller.h" | 13 #include "components/test_runner/accessibility_controller.h" |
13 #include "components/test_runner/event_sender.h" | 14 #include "components/test_runner/event_sender.h" |
14 #include "components/test_runner/mock_color_chooser.h" | 15 #include "components/test_runner/mock_color_chooser.h" |
15 #include "components/test_runner/mock_screen_orientation_client.h" | 16 #include "components/test_runner/mock_screen_orientation_client.h" |
16 #include "components/test_runner/mock_web_user_media_client.h" | 17 #include "components/test_runner/mock_web_user_media_client.h" |
17 #include "components/test_runner/test_common.h" | 18 #include "components/test_runner/test_common.h" |
18 #include "components/test_runner/test_interfaces.h" | 19 #include "components/test_runner/test_interfaces.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 return true; | 753 return true; |
753 } | 754 } |
754 | 755 |
755 return false; | 756 return false; |
756 } | 757 } |
757 | 758 |
758 void WebFrameTestClient::checkIfAudioSinkExistsAndIsAuthorized( | 759 void WebFrameTestClient::checkIfAudioSinkExistsAndIsAuthorized( |
759 const blink::WebString& sink_id, | 760 const blink::WebString& sink_id, |
760 const blink::WebSecurityOrigin& security_origin, | 761 const blink::WebSecurityOrigin& security_origin, |
761 blink::WebSetSinkIdCallbacks* web_callbacks) { | 762 blink::WebSetSinkIdCallbacks* web_callbacks) { |
762 scoped_ptr<blink::WebSetSinkIdCallbacks> callback(web_callbacks); | 763 std::unique_ptr<blink::WebSetSinkIdCallbacks> callback(web_callbacks); |
763 std::string device_id = sink_id.utf8(); | 764 std::string device_id = sink_id.utf8(); |
764 if (device_id == "valid" || device_id.empty()) | 765 if (device_id == "valid" || device_id.empty()) |
765 callback->onSuccess(); | 766 callback->onSuccess(); |
766 else if (device_id == "unauthorized") | 767 else if (device_id == "unauthorized") |
767 callback->onError(blink::WebSetSinkIdError::NotAuthorized); | 768 callback->onError(blink::WebSetSinkIdError::NotAuthorized); |
768 else | 769 else |
769 callback->onError(blink::WebSetSinkIdError::NotFound); | 770 callback->onError(blink::WebSetSinkIdError::NotFound); |
770 } | 771 } |
771 | 772 |
772 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { | 773 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { |
773 web_test_proxy_base_->test_interfaces()->BindTo(frame); | 774 web_test_proxy_base_->test_interfaces()->BindTo(frame); |
774 web_test_proxy_base_->BindTo(frame); | 775 web_test_proxy_base_->BindTo(frame); |
775 } | 776 } |
776 | 777 |
777 } // namespace test_runner | 778 } // namespace test_runner |
OLD | NEW |