Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Issue 2562683004: Fix gmock leak issue in AutoplayUmaHelperTest (Closed)

Created:
4 years ago by Zhiqiang Zhang (Slow)
Modified:
4 years ago
Reviewers:
whywhat
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix gmock leak issue in AutoplayUmaHelperTest AutoplayUmaHelperTest currently uses GMock for mock AutoplayUmaHelper in order to check if events are correctly received. However this will make the test flaky since MockAutoplyUmaHelper is garbage-collected but GMock expect it to be destroyed when the test finishes. This CL marks MockAutoplayUmaHelper as AllowLeak which fixes the issue. BUG=672831 Committed: https://crrev.com/8906ce8b964bf3431b891bc9eaaca54ad8981f7d Cr-Commit-Position: refs/heads/master@{#437939}

Patch Set 1 #

Patch Set 2 : using Mock::AllowLeak #

Patch Set 3 : Using VerifyAndClear #

Total comments: 2

Patch Set 4 : removed AllowLeak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -11 lines) Patch
M third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp View 1 2 3 1 chunk +8 lines, -11 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
Zhiqiang Zhang (Slow)
4 years ago (2016-12-09 16:25:53 UTC) #2
whywhat
Why don't you just use ::testing::Mock::VerifyAndClear() at the end of each test case and don't ...
4 years ago (2016-12-09 16:30:24 UTC) #3
Zhiqiang Zhang (Slow)
PTAL On 2016/12/09 16:30:24, whywhat wrote: > Why don't you just use ::testing::Mock::VerifyAndClear() at the ...
4 years ago (2016-12-09 17:08:05 UTC) #4
whywhat
On 2016/12/09 at 17:08:05, zqzhang wrote: > PTAL > > On 2016/12/09 16:30:24, whywhat wrote: ...
4 years ago (2016-12-09 19:46:24 UTC) #5
Zhiqiang Zhang (Slow)
On 2016/12/09 19:46:24, whywhat wrote: > On 2016/12/09 at 17:08:05, zqzhang wrote: > > PTAL ...
4 years ago (2016-12-09 21:56:51 UTC) #7
whywhat
lgtm https://codereview.chromium.org/2562683004/diff/40001/third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp File third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp (right): https://codereview.chromium.org/2562683004/diff/40001/third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp#newcode60 third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp:60: ::testing::Mock::AllowLeak(&element.m_autoplayUmaHelper); nit: you don't need this anymore - ...
4 years ago (2016-12-09 22:16:42 UTC) #8
Zhiqiang Zhang (Slow)
https://codereview.chromium.org/2562683004/diff/40001/third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp File third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp (right): https://codereview.chromium.org/2562683004/diff/40001/third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp#newcode60 third_party/WebKit/Source/core/html/AutoplayUmaHelperTest.cpp:60: ::testing::Mock::AllowLeak(&element.m_autoplayUmaHelper); On 2016/12/09 22:16:42, whywhat wrote: > nit: you ...
4 years ago (2016-12-12 20:31:24 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2562683004/60001
4 years ago (2016-12-12 20:33:15 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-12 22:45:09 UTC) #15
commit-bot: I haz the power
4 years ago (2016-12-12 22:48:18 UTC) #17
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/8906ce8b964bf3431b891bc9eaaca54ad8981f7d
Cr-Commit-Position: refs/heads/master@{#437939}

Powered by Google App Engine
This is Rietveld 408576698