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

Unified Diff: third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp

Issue 2539323002: PerformanceMonitor: do not maintain a vector of frames in the monitor, single ExecutionContext memb… (Closed)
Patch Set: off-by-one in depth fixed Created 4 years 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/frame/PerformanceMonitorTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp b/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp
index 4dea09b19b6641ad3e27c426b9559204786db331..17c4f8283cfcd5a4cddb8a6b70d7bd4fe9e1c70d 100644
--- a/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp
+++ b/third_party/WebKit/Source/core/frame/PerformanceMonitorTest.cpp
@@ -29,7 +29,7 @@ class PerformanceMonitorTest : public ::testing::Test {
}
void willExecuteScript(ExecutionContext* executionContext) {
- m_monitor->innerWillExecuteScript(executionContext);
+ m_monitor->alwaysWillExecuteScript(executionContext);
}
void willProcessTask() { m_monitor->willProcessTask(); }
@@ -64,14 +64,18 @@ void PerformanceMonitorTest::SetUp() {
String PerformanceMonitorTest::frameContextURL() {
// This is reported only if there is a single frameContext URL.
- if (m_monitor->m_frameContexts.size() != 1)
+ if (m_monitor->m_taskHasMultipleContexts)
return "";
- Frame* frame = (*m_monitor->m_frameContexts.begin()).get();
+ Frame* frame = toDocument(m_monitor->m_taskExecutionContext)->frame();
return toLocalFrame(frame)->document()->location()->href();
}
int PerformanceMonitorTest::numUniqueFrameContextsSeen() {
- return m_monitor->m_frameContexts.size();
+ if (!m_monitor->m_taskExecutionContext)
+ return 0;
+ if (!m_monitor->m_taskHasMultipleContexts)
+ return 1;
+ return 2;
}
TEST_F(PerformanceMonitorTest, SingleScriptInTask) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp ('k') | third_party/WebKit/Source/core/timing/Performance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698