1 // Copyright 2012 Google Inc. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef TV_GTVREMOTE_TESTS_POLO_PAIRING_MOCKS_H_ 16 #define TV_GTVREMOTE_TESTS_POLO_PAIRING_MOCKS_H_ 17 18 #include <gmock/gmock.h> 19 #include <polo/pairing/polochallengeresponse.h> 20 21 namespace polo { 22 namespace pairing { 23 24 // A mock PoloChallengeResponse. 25 class MockChallengeResponse : public PoloChallengeResponse { 26 public: MockChallengeResponse()27 MockChallengeResponse() : PoloChallengeResponse(NULL, NULL) {} 28 MOCK_CONST_METHOD1(GetAlpha, Alpha*(const Nonce& nonce)); 29 MOCK_CONST_METHOD1(GetGamma, Gamma*(const Nonce& nonce)); 30 MOCK_CONST_METHOD1(ExtractNonce, Nonce*(const Gamma& gamma)); 31 MOCK_CONST_METHOD1(CheckGamma, bool(const Gamma& gammma)); 32 }; 33 34 // A mock PairingListener. 35 class MockPairingListener : public PairingListener { 36 public: 37 MOCK_METHOD0(OnSessionCreated, void()); 38 MOCK_METHOD0(OnSessionEnded, void()); 39 MOCK_METHOD1(OnPerformOutputDeviceRole, void(const Gamma& gamma)); 40 MOCK_METHOD0(OnPerformInputDeviceRole, void()); 41 MOCK_METHOD0(OnPairingSuccess, void()); 42 MOCK_METHOD0(OnPairingCancelled, void()); 43 MOCK_METHOD1(OnError, void(PoloError error)); 44 }; 45 46 } // namespace pairing 47 } // namespace polo 48 49 #endif // TV_GTVREMOTE_TESTS_POLO_PAIRING_MOCKS_H_ 50