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

Side by Side Diff: third_party/WebKit/Source/core/timing/PerformanceTest.cpp

Issue 2553493003: Add more detail to same-origin attribution indicating self|ancestor|descendant (Closed)
Patch Set: update layout test 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/timing/Performance.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/timing/Performance.h" 5 #include "core/timing/Performance.h"
6 6
7 #include "core/frame/PerformanceMonitor.h" 7 #include "core/frame/PerformanceMonitor.h"
8 #include "core/testing/DummyPageHolder.h" 8 #include "core/testing/DummyPageHolder.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 removeLongTaskObserver(); 74 removeLongTaskObserver();
75 m_performance->updateLongTaskInstrumentation(); 75 m_performance->updateLongTaskInstrumentation();
76 EXPECT_FALSE(observingLongTasks()); 76 EXPECT_FALSE(observingLongTasks());
77 } 77 }
78 78
79 TEST_F(PerformanceTest, SanitizedLongTaskName) { 79 TEST_F(PerformanceTest, SanitizedLongTaskName) {
80 // Unable to attribute, when no execution contents are available. 80 // Unable to attribute, when no execution contents are available.
81 EXPECT_EQ("unknown", sanitizedAttribution(nullptr, false, frame())); 81 EXPECT_EQ("unknown", sanitizedAttribution(nullptr, false, frame()));
82 82
83 // Attribute for same context (and same origin). 83 // Attribute for same context (and same origin).
84 EXPECT_EQ("same-origin", sanitizedAttribution(document(), false, frame())); 84 EXPECT_EQ("same-origin-self",
85 sanitizedAttribution(document(), false, frame()));
85 86
86 // Unable to attribute, when multiple script execution contents are involved. 87 // Unable to attribute, when multiple script execution contents are involved.
87 EXPECT_EQ("multiple-contexts", 88 EXPECT_EQ("multiple-contexts",
88 sanitizedAttribution(document(), true, frame())); 89 sanitizedAttribution(document(), true, frame()));
89 } 90 }
90 91
91 TEST_F(PerformanceTest, SanitizedLongTaskName_CrossOrigin) { 92 TEST_F(PerformanceTest, SanitizedLongTaskName_CrossOrigin) {
92 // Unable to attribute, when no execution contents are available. 93 // Unable to attribute, when no execution contents are available.
93 EXPECT_EQ("unknown", sanitizedAttribution(nullptr, false, frame())); 94 EXPECT_EQ("unknown", sanitizedAttribution(nullptr, false, frame()));
94 95
95 // Attribute for same context (and same origin). 96 // Attribute for same context (and same origin).
96 EXPECT_EQ("cross-origin-unreachable", 97 EXPECT_EQ("cross-origin-unreachable",
97 sanitizedAttribution(anotherDocument(), false, frame())); 98 sanitizedAttribution(anotherDocument(), false, frame()));
98 } 99 }
99 } 100 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/Performance.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698