Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "gmock/gmock.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 class Interface { | |
| 10 public: | |
| 11 virtual void myMethod(int my_param){}; | |
|
dcheng
2017/01/09 19:27:47
Nit: remove ;
Łukasz Anforowicz
2017/01/09 20:11:27
Done.
| |
| 12 }; | |
| 13 | |
| 14 class MockedInterface : public Interface { | |
| 15 public: | |
| 16 MOCK_METHOD1(myMethod, void(int)); | |
| 17 }; | |
| 18 | |
| 19 void test() { | |
| 20 MockedInterface mockedInterface; | |
| 21 EXPECT_CALL(mockedInterface, myMethod(1)); | |
| 22 EXPECT_CALL( | |
| 23 mockedInterface, // A comment to prevent reformatting into single line. | |
| 24 myMethod(1)); | |
| 25 mockedInterface.myMethod(123); | |
| 26 } | |
| 27 | |
| 28 } // namespace blink | |
| OLD | NEW |