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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceTest.cpp

Issue 2449673002: Refactor InspectorWebPerfAgent: update lifecycle management to be per Local Frame root; replace hea… (Closed)
Patch Set: sync and rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..07331252ea099a238762a2f4ea91be29cd36a4c4 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceTest.cpp
@@ -17,9 +17,7 @@ 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(); }
void addLongTaskObserver() {
// simulate with filter options.
@@ -37,21 +35,16 @@ class PerformanceTest : public ::testing::Test {
TEST_F(PerformanceTest, LongTaskObserverInstrumentation) {
m_performance->updateLongTaskInstrumentation();
- EXPECT_FALSE(hasLongTaskInspectorAgent());
+ 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(observingLongTasks());
// Removing LongTask observer disables instrumentation.
removeLongTaskObserver();
m_performance->updateLongTaskInstrumentation();
- EXPECT_FALSE(hasLongTaskInspectorAgent());
+ EXPECT_FALSE(observingLongTasks());
}
}

Powered by Google App Engine
This is Rietveld 408576698