DescriptionMoving ScopedMockLog from net/test to base/test.
I want to reuse ScopedMockLog from unittests under src/remoting/host.
To do that, I am moving this class from net/test to base/test.
When doing the move, I also wanted to ensure thread-safety in the case when
logging is happening on a thread different from where StartCapturingLogs or
StopCapturingLogs are called. Having proper locks (and memory barriers implied
by the locks) should ensure that 1) LogMessageHandler won't see a half-way
executed StartCapturingLogs or StopCapturingLogs and 2) that a log write
in-progress won't get a rug pulled from underneath by destroying of gMock's
structures embedded in ScopedMockLog's Log mock method.
BUG=
TEST=net_unittests
Committed: https://crrev.com/b4d01d31b4553b10aae55b66476e5ab9280b1c9d
Cr-Commit-Position: refs/heads/master@{#319105}
Patch Set 1 : New unit tests for PolicyWatcher #Patch Set 2 : Limiting the changes to moving ScopedMockLog to base/test #
Total comments: 15
Patch Set 3 : Addressed Ricardo's code review feedback. #
Messages
Total messages: 14 (7 generated)
|