OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ | 5 #ifndef IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ |
6 #define IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ | 6 #define IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ |
7 | 7 |
8 #include "ios/chrome/test/ocmock/scoped_mock_object.h" | 8 #import "ios/chrome/test/ocmock/scoped_mock_object.h" |
9 #include "third_party/ocmock/gtest_support.h" | 9 #include "third_party/ocmock/gtest_support.h" |
10 | 10 |
11 // Helper class that constructs an OCMock and automatically verifies the mock | 11 // Helper class that constructs an OCMock and automatically verifies the mock |
12 // upon destruction. | 12 // upon destruction. |
13 template <typename NST> | 13 template <typename NST> |
14 class ScopedVerifyingMockObject : public ScopedMockObject<NST> { | 14 class ScopedVerifyingMockObject : public ScopedMockObject<NST> { |
15 public: | 15 public: |
16 ScopedVerifyingMockObject() {} | 16 ScopedVerifyingMockObject() {} |
17 | 17 |
18 ~ScopedVerifyingMockObject() { | 18 ~ScopedVerifyingMockObject() { |
19 EXPECT_OCMOCK_VERIFY(ScopedMockObject<NST>::get()); | 19 EXPECT_OCMOCK_VERIFY(ScopedMockObject<NST>::get()); |
20 } | 20 } |
21 }; | 21 }; |
22 | 22 |
23 #endif // IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ | 23 #endif // IOS_CHROME_TEST_OCMOCK_SCOPED_VERIFYING_MOCK_OBJECT_H_ |
OLD | NEW |