| Index: third_party/WebKit/Source/core/timing/PerformanceTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/timing/PerformanceTest.cpp b/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
|
| index b4eb55006e2fbbad22dfcf723ba430cff15dc2de..c0d1c3d611c79ceba4d332a89b316ddcfd58c263 100644
|
| --- a/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
|
| +++ b/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
|
| @@ -17,8 +17,10 @@ class PerformanceTest : public ::testing::Test {
|
| m_performance = Performance::create(&m_pageHolder->frame());
|
| }
|
|
|
| - bool hasLongTaskInspectorAgent() {
|
| - return m_performance->m_longTaskInspectorAgent;
|
| + bool observingLongTasks() { return m_performance->observingLongTasks(); }
|
| +
|
| + bool hasLongTaskAgentObservers() {
|
| + return m_performance->frame()->webPerformanceObservers().size() > 0;
|
| }
|
|
|
| void addLongTaskObserver() {
|
| @@ -37,21 +39,19 @@ class PerformanceTest : public ::testing::Test {
|
|
|
| TEST_F(PerformanceTest, LongTaskObserverInstrumentation) {
|
| m_performance->updateLongTaskInstrumentation();
|
| - EXPECT_FALSE(hasLongTaskInspectorAgent());
|
| + EXPECT_FALSE(hasLongTaskAgentObservers());
|
| + EXPECT_FALSE(observingLongTasks());
|
|
|
| // Adding LongTask observer (with filer option) enables instrumentation.
|
| addLongTaskObserver();
|
| m_performance->updateLongTaskInstrumentation();
|
| - EXPECT_TRUE(hasLongTaskInspectorAgent());
|
| -
|
| - // While LongTask observer is present, updateLongTaskInstrumentation has no
|
| - // effect.
|
| - m_performance->updateLongTaskInstrumentation();
|
| - EXPECT_TRUE(hasLongTaskInspectorAgent());
|
| + EXPECT_TRUE(hasLongTaskAgentObservers());
|
| + EXPECT_TRUE(observingLongTasks());
|
|
|
| // Removing LongTask observer disables instrumentation.
|
| removeLongTaskObserver();
|
| m_performance->updateLongTaskInstrumentation();
|
| - EXPECT_FALSE(hasLongTaskInspectorAgent());
|
| + EXPECT_FALSE(hasLongTaskAgentObservers());
|
| + EXPECT_FALSE(observingLongTasks());
|
| }
|
| }
|
|
|