David Ghandehari | 6017030 | 2017-03-10 21:18:13 -0800 | [diff] [blame] | 1 | // Copyright 2015 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. |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 14 | |
| 15 | #ifndef COBALT_BINDINGS_TESTING_NAMED_CONSTRUCTOR_INTERFACE_H_ |
| 16 | #define COBALT_BINDINGS_TESTING_NAMED_CONSTRUCTOR_INTERFACE_H_ |
| 17 | |
| 18 | #include "base/lazy_instance.h" |
| 19 | #include "cobalt/script/wrappable.h" |
| 20 | #include "testing/gmock/include/gmock/gmock.h" |
| 21 | |
| 22 | namespace cobalt { |
| 23 | namespace bindings { |
| 24 | namespace testing { |
| 25 | |
| 26 | class NamedConstructorInterface : public script::Wrappable { |
| 27 | public: |
| 28 | class ConstructorImplementationMock { |
| 29 | public: |
| 30 | MOCK_METHOD0(Constructor, void()); |
| 31 | }; |
| 32 | NamedConstructorInterface() { |
| 33 | constructor_implementation_mock.Get().Constructor(); |
| 34 | } |
| 35 | |
| 36 | DEFINE_WRAPPABLE_TYPE(NamedConstructorInterface); |
| 37 | |
| 38 | static base::LazyInstance< ::testing::StrictMock< |
| 39 | ConstructorImplementationMock> > constructor_implementation_mock; |
| 40 | }; |
| 41 | |
| 42 | } // namespace testing |
| 43 | } // namespace bindings |
| 44 | } // namespace cobalt |
| 45 | |
| 46 | #endif // COBALT_BINDINGS_TESTING_NAMED_CONSTRUCTOR_INTERFACE_H_ |