diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-01-19 17:09:02 -0800 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-01-20 01:11:31 +0000 |
commit | bcd3f6a43fe40184fb5d30860c6a2cf9f9e7a11e (patch) | |
tree | 7124682750c9add49d79cd11f3144060a5856a8e | |
parent | c08442f363b23073608af7856ddbdb3ea60a6f37 (diff) | |
download | libweave-bcd3f6a43fe40184fb5d30860c6a2cf9f9e7a11e.tar.gz |
Fix clock mock in ComponentManagerTest
BUG:26561788
Change-Id: I2f12db6de0faea940256f670fe8c6143c9858e63
Reviewed-on: https://weave-review.googlesource.com/2220
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
-rw-r--r-- | src/component_manager_unittest.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/component_manager_unittest.cc b/src/component_manager_unittest.cc index 519b80a..63fedac 100644 --- a/src/component_manager_unittest.cc +++ b/src/component_manager_unittest.cc @@ -18,6 +18,7 @@ namespace weave { using test::CreateDictionaryValue; using testing::Return; +using testing::StrictMock; namespace { @@ -69,6 +70,10 @@ bool HasTrait(const base::DictionaryValue& comp, const std::string& trait) { // } class ComponentManagerTest : public ::testing::Test { protected: + void SetUp() override { + EXPECT_CALL(clock_, Now()).WillRepeatedly(Return(base::Time::Now())); + } + void CreateTestComponentTree(ComponentManager* manager) { const char kTraits[] = R"({"t1":{},"t2":{},"t3":{},"t4":{},"t5":{},"t6":{}})"; @@ -85,7 +90,7 @@ class ComponentManagerTest : public ::testing::Test { {"t5", "t6"}, nullptr)); } - test::MockClock clock_; + StrictMock<test::MockClock> clock_; ComponentManagerImpl manager_{&clock_}; }; |