[tracing] r39794 follow-up: Update the missing part of the test.

The test now checks the case when an observer is added after tracing is started.

BUG=chromium:406277

Review-Url: https://codereview.chromium.org/2376953002
Cr-Commit-Position: refs/heads/master@{#39874}
This commit is contained in:
alph 2016-09-29 08:13:25 -07:00 committed by Commit bot
parent 7496c9de94
commit 57b0e37443

View File

@ -372,10 +372,23 @@ TEST(TracingObservers) {
CHECK_EQ(1, observer.enabled_count);
CHECK_EQ(0, observer.disabled_count);
TraceStateObserverImpl observer2;
default_platform->AddTraceStateObserver(&observer2);
CHECK_EQ(1, observer2.enabled_count);
CHECK_EQ(0, observer2.disabled_count);
default_platform->RemoveTraceStateObserver(&observer2);
CHECK_EQ(1, observer2.enabled_count);
CHECK_EQ(0, observer2.disabled_count);
tracing_controller.StopTracing();
CHECK_EQ(1, observer.enabled_count);
CHECK_EQ(1, observer.disabled_count);
CHECK_EQ(1, observer2.enabled_count);
CHECK_EQ(0, observer2.disabled_count);
default_platform->RemoveTraceStateObserver(&observer);