media: Use NiceMock<MockCdm> in MockCdmFactory
The MockCdmFactory just creates the MockCdm and should not expect what calls will be made on the MockCdm. Hence, replace StrictMock with NiceMock. Test cases that expect calls on MockCdm should get the MockCdm via MockCdmFactory::GetCreatedCdm() and explicitly specify expectations using EXPECT_CALL. This is also consistent with googlemock guidelines [1]: """ Our general recommendation is to use nice mocks (not yet the default) most of the time, use naggy mocks (the current default) when developing or debugging tests, and use strict mocks only as the last resort. """ [1] https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md#the-nice-the-strict-and-the-naggy-nicestrictnaggy Bug: 1018854 Test: Update test helper classes. No functionality change. Change-Id: I197f83b221296beccd05b82d2b6ae030381178e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890970 Commit-Queue: Xiaohan Wang <xhwang@chromium.org> Reviewed-by:John Rummell <jrummell@chromium.org> Cr-Commit-Position: refs/heads/master@{#710980}
Showing
Please register or sign in to comment