Commit 34419228 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

interactive-ui-tests: Assert if trace is not started

Add an assert to catch the case where the derived tests
forgot to call PerformanceTest::SetUpOnMainThread to start
tracing.

Bug: 945709
Change-Id: Id3a659f172f5fde09220003b7a3fc57f18c832fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566610
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650516}
parent af5e094c
...@@ -57,6 +57,9 @@ void PerformanceTest::SetUpOnMainThread() { ...@@ -57,6 +57,9 @@ void PerformanceTest::SetUpOnMainThread() {
void PerformanceTest::TearDownOnMainThread() { void PerformanceTest::TearDownOnMainThread() {
if (should_start_trace_) { if (should_start_trace_) {
auto* controller = content::TracingController::GetInstance(); auto* controller = content::TracingController::GetInstance();
ASSERT_TRUE(controller->IsTracing())
<< "Did you forget to call PerformanceTest::SetUpOnMainThread?";
base::RunLoop runloop; base::RunLoop runloop;
base::FilePath dir = base::FilePath dir =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(kTraceDir); base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(kTraceDir);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment