| 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 "modules/presentation/PresentationReceiver.h" | 5 #include "modules/presentation/PresentationReceiver.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "bindings/core/v8/V8BindingForTesting.h" | 8 #include "bindings/core/v8/V8BindingForTesting.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 callbacks) override { | 36 callbacks) override { |
| 37 return startSession_(presentationUrls, callbacks); | 37 return startSession_(presentationUrls, callbacks); |
| 38 } | 38 } |
| 39 void joinSession(const WebVector<WebURL>& presentationUrls, | 39 void joinSession(const WebVector<WebURL>& presentationUrls, |
| 40 const WebString& presentationId, | 40 const WebString& presentationId, |
| 41 std::unique_ptr<WebPresentationConnectionClientCallbacks> | 41 std::unique_ptr<WebPresentationConnectionClientCallbacks> |
| 42 callbacks) override { | 42 callbacks) override { |
| 43 return joinSession_(presentationUrls, presentationId, callbacks); | 43 return joinSession_(presentationUrls, presentationId, callbacks); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void getAvailability(const WebURL& availabilityURL, | 46 void getAvailability(const WebVector<WebURL>& availabilityURLs, |
| 47 std::unique_ptr<WebPresentationAvailabilityCallbacks> | 47 std::unique_ptr<WebPresentationAvailabilityCallbacks> |
| 48 callbacks) override { | 48 callbacks) override { |
| 49 return getAvailability_(availabilityURL, callbacks); | 49 return getAvailability_(availabilityURLs, callbacks); |
| 50 } | 50 } |
| 51 | 51 |
| 52 public: | 52 public: |
| 53 MOCK_METHOD1(setController, void(WebPresentationController*)); | 53 MOCK_METHOD1(setController, void(WebPresentationController*)); |
| 54 | 54 |
| 55 MOCK_METHOD1(setReceiver, void(WebPresentationReceiver*)); | 55 MOCK_METHOD1(setReceiver, void(WebPresentationReceiver*)); |
| 56 | 56 |
| 57 MOCK_METHOD2( | 57 MOCK_METHOD2( |
| 58 startSession_, | 58 startSession_, |
| 59 void(const WebVector<WebURL>& presentationUrls, | 59 void(const WebVector<WebURL>& presentationUrls, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 MOCK_METHOD2(closeSession, | 85 MOCK_METHOD2(closeSession, |
| 86 void(const WebURL& presentationUrl, | 86 void(const WebURL& presentationUrl, |
| 87 const WebString& presentationId)); | 87 const WebString& presentationId)); |
| 88 | 88 |
| 89 MOCK_METHOD2(terminateSession, | 89 MOCK_METHOD2(terminateSession, |
| 90 void(const WebURL& presentationUrl, | 90 void(const WebURL& presentationUrl, |
| 91 const WebString& presentationId)); | 91 const WebString& presentationId)); |
| 92 | 92 |
| 93 MOCK_METHOD2(getAvailability_, | 93 MOCK_METHOD2(getAvailability_, |
| 94 void(const WebURL& availabilityUrl, | 94 void(const WebVector<WebURL>& availabilityUrls, |
| 95 std::unique_ptr<WebPresentationAvailabilityCallbacks>&)); | 95 std::unique_ptr<WebPresentationAvailabilityCallbacks>&)); |
| 96 | 96 |
| 97 MOCK_METHOD1(startListening, void(WebPresentationAvailabilityObserver*)); | 97 MOCK_METHOD1(startListening, void(WebPresentationAvailabilityObserver*)); |
| 98 | 98 |
| 99 MOCK_METHOD1(stopListening, void(WebPresentationAvailabilityObserver*)); | 99 MOCK_METHOD1(stopListening, void(WebPresentationAvailabilityObserver*)); |
| 100 | 100 |
| 101 MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&)); | 101 MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&)); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 class TestWebPresentationConnectionClient | 104 class TestWebPresentationConnectionClient |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 TEST_F(PresentationReceiverTest, CreateReceiver) { | 222 TEST_F(PresentationReceiverTest, CreateReceiver) { |
| 223 MockWebPresentationClient client; | 223 MockWebPresentationClient client; |
| 224 EXPECT_CALL(client, setReceiver(testing::_)); | 224 EXPECT_CALL(client, setReceiver(testing::_)); |
| 225 | 225 |
| 226 V8TestingScope scope; | 226 V8TestingScope scope; |
| 227 new PresentationReceiver(&scope.frame(), &client); | 227 new PresentationReceiver(&scope.frame(), &client); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |