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

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

Issue 2395653002: Remove buffering from PerformanceLongTaskTiming as it's not in the spec. (Closed)
Patch Set: update layout test expectations Created 4 years, 2 months 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/PerformanceBaseTest.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp b/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp
index e9bd66435ee7f8d587d6e6ab3f2335dcc778dba3..b2c876f85b8eaea75e4172a3abaeacc905d3badc 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp
@@ -25,7 +25,9 @@ class TestPerformanceBase : public PerformanceBase {
int numObservers() { return m_observers.size(); }
- int numLongTaskTimingEntries() { return m_longTaskTimingBuffer.size(); }
+ bool hasPerformanceObserverFor(PerformanceEntry::EntryType entryType) {
+ return hasObserverFor(entryType);
+ }
DEFINE_INLINE_TRACE() { PerformanceBase::trace(visitor); }
};
@@ -41,6 +43,10 @@ class PerformanceBaseTest : public ::testing::Test {
m_observer = PerformanceObserver::create(scriptState, m_base, m_cb);
}
+ int numPerformanceEntriesInObserver() {
+ return m_observer->m_performanceEntries.size();
+ }
+
Persistent<TestPerformanceBase> m_base;
Persistent<PerformanceObserver> m_observer;
Persistent<PerformanceObserverCallback> m_cb;
@@ -88,7 +94,8 @@ TEST_F(PerformanceBaseTest, AddLongTaskTiming) {
// Add a long task entry, but no observer registered.
m_base->addLongTaskTiming(1234, 5678, "www.foo.com/bar", nullptr);
- EXPECT_EQ(0, m_base->numLongTaskTimingEntries()); // has no effect
+ EXPECT_FALSE(m_base->hasPerformanceObserverFor(PerformanceEntry::LongTask));
+ EXPECT_EQ(0, numPerformanceEntriesInObserver()); // has no effect
// Make an observer for longtask
NonThrowableExceptionState exceptionState;
@@ -98,9 +105,9 @@ TEST_F(PerformanceBaseTest, AddLongTaskTiming) {
options.setEntryTypes(entryTypeVec);
m_observer->observe(options, exceptionState);
+ EXPECT_TRUE(m_base->hasPerformanceObserverFor(PerformanceEntry::LongTask));
// Add a long task entry
m_base->addLongTaskTiming(1234, 5678, "www.foo.com/bar", nullptr);
- EXPECT_EQ(1, m_base->numLongTaskTimingEntries()); // added an entry
+ EXPECT_EQ(1, numPerformanceEntriesInObserver()); // added an entry
}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.cpp ('k') | third_party/WebKit/Source/core/timing/PerformanceObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698