| 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 24 matching lines...) Expand all Loading... |
| 35 std::unique_ptr<WebPresentationConnectionCallback> callbacks) override { | 35 std::unique_ptr<WebPresentationConnectionCallback> callbacks) override { |
| 36 return startSession_(presentationUrls, callbacks); | 36 return startSession_(presentationUrls, callbacks); |
| 37 } | 37 } |
| 38 void joinSession( | 38 void joinSession( |
| 39 const WebVector<WebURL>& presentationUrls, | 39 const WebVector<WebURL>& presentationUrls, |
| 40 const WebString& presentationId, | 40 const WebString& presentationId, |
| 41 std::unique_ptr<WebPresentationConnectionCallback> callbacks) override { | 41 std::unique_ptr<WebPresentationConnectionCallback> callbacks) override { |
| 42 return joinSession_(presentationUrls, presentationId, callbacks); | 42 return joinSession_(presentationUrls, presentationId, callbacks); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void getAvailability(const WebURL& availabilityURL, | 45 void getAvailability(const WebVector<WebURL>& availabilityURLs, |
| 46 std::unique_ptr<WebPresentationAvailabilityCallbacks> | 46 std::unique_ptr<WebPresentationAvailabilityCallbacks> |
| 47 callbacks) override { | 47 callbacks) override { |
| 48 return getAvailability_(availabilityURL, callbacks); | 48 return getAvailability_(availabilityURLs, callbacks); |
| 49 } | 49 } |
| 50 | 50 |
| 51 public: | 51 public: |
| 52 MOCK_METHOD1(setController, void(WebPresentationController*)); | 52 MOCK_METHOD1(setController, void(WebPresentationController*)); |
| 53 | 53 |
| 54 MOCK_METHOD1(setReceiver, void(WebPresentationReceiver*)); | 54 MOCK_METHOD1(setReceiver, void(WebPresentationReceiver*)); |
| 55 | 55 |
| 56 MOCK_METHOD2(startSession_, | 56 MOCK_METHOD2(startSession_, |
| 57 void(const WebVector<WebURL>& presentationUrls, | 57 void(const WebVector<WebURL>& presentationUrls, |
| 58 std::unique_ptr<WebPresentationConnectionCallback>&)); | 58 std::unique_ptr<WebPresentationConnectionCallback>&)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 MOCK_METHOD2(closeSession, | 82 MOCK_METHOD2(closeSession, |
| 83 void(const WebURL& presentationUrl, | 83 void(const WebURL& presentationUrl, |
| 84 const WebString& presentationId)); | 84 const WebString& presentationId)); |
| 85 | 85 |
| 86 MOCK_METHOD2(terminateSession, | 86 MOCK_METHOD2(terminateSession, |
| 87 void(const WebURL& presentationUrl, | 87 void(const WebURL& presentationUrl, |
| 88 const WebString& presentationId)); | 88 const WebString& presentationId)); |
| 89 | 89 |
| 90 MOCK_METHOD2(getAvailability_, | 90 MOCK_METHOD2(getAvailability_, |
| 91 void(const WebURL& availabilityUrl, | 91 void(const WebVector<WebURL>& availabilityUrls, |
| 92 std::unique_ptr<WebPresentationAvailabilityCallbacks>&)); | 92 std::unique_ptr<WebPresentationAvailabilityCallbacks>&)); |
| 93 | 93 |
| 94 MOCK_METHOD1(startListening, void(WebPresentationAvailabilityObserver*)); | 94 MOCK_METHOD1(startListening, void(WebPresentationAvailabilityObserver*)); |
| 95 | 95 |
| 96 MOCK_METHOD1(stopListening, void(WebPresentationAvailabilityObserver*)); | 96 MOCK_METHOD1(stopListening, void(WebPresentationAvailabilityObserver*)); |
| 97 | 97 |
| 98 MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&)); | 98 MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&)); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 class PresentationReceiverTest : public ::testing::Test { | 101 class PresentationReceiverTest : public ::testing::Test { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 TEST_F(PresentationReceiverTest, CreateReceiver) { | 209 TEST_F(PresentationReceiverTest, CreateReceiver) { |
| 210 MockWebPresentationClient client; | 210 MockWebPresentationClient client; |
| 211 EXPECT_CALL(client, setReceiver(testing::_)); | 211 EXPECT_CALL(client, setReceiver(testing::_)); |
| 212 | 212 |
| 213 V8TestingScope scope; | 213 V8TestingScope scope; |
| 214 new PresentationReceiver(&scope.frame(), &client); | 214 new PresentationReceiver(&scope.frame(), &client); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace blink | 217 } // namespace blink |
| OLD | NEW |