| Index: third_party/WebKit/Source/core/inspector/InspectorWebPerfAgentTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgentTest.cpp b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgentTest.cpp
|
| index 0ec06dbf91af6efaea42000aab55be819b3e64ec..ba29066fe0013a71b59187dfea7e6cb6be320381 100644
|
| --- a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgentTest.cpp
|
| +++ b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgentTest.cpp
|
| @@ -34,7 +34,8 @@ class InspectorWebPerfAgentTest : public ::testing::Test {
|
| String sanitizedLongTaskName(
|
| HeapHashSet<Member<Location>> frameContextLocations,
|
| Frame* rootFrame) {
|
| - return m_agent->sanitizedLongTaskName(frameContextLocations, rootFrame);
|
| + return m_agent->sanitizedAttribution(frameContextLocations, rootFrame)
|
| + .first;
|
| }
|
|
|
| Persistent<InspectorWebPerfAgent> m_agent;
|
| @@ -135,7 +136,7 @@ TEST_F(InspectorWebPerfAgentTest, SanitizedLongTaskName) {
|
|
|
| // Attribute for same context (and same origin).
|
| frameContextLocations.add(Location::create(frame()));
|
| - EXPECT_EQ("https://example.com/foo",
|
| + EXPECT_EQ("same-origin",
|
| sanitizedLongTaskName(frameContextLocations, frame()));
|
|
|
| // Unable to attribute, when multiple script execution contents are involved.
|
| @@ -144,4 +145,15 @@ TEST_F(InspectorWebPerfAgentTest, SanitizedLongTaskName) {
|
| sanitizedLongTaskName(frameContextLocations, frame()));
|
| }
|
|
|
| +TEST_F(InspectorWebPerfAgentTest, SanitizedLongTaskName_CrossOrigin) {
|
| + HeapHashSet<Member<Location>> frameContextLocations;
|
| + // Unable to attribute, when no execution contents are available.
|
| + EXPECT_EQ("unknown", sanitizedLongTaskName(frameContextLocations, frame()));
|
| +
|
| + // Attribute for same context (and same origin).
|
| + frameContextLocations.add(Location::create(anotherFrame()));
|
| + EXPECT_EQ("cross-origin-unreachable",
|
| + sanitizedLongTaskName(frameContextLocations, frame()));
|
| +}
|
| +
|
| } // namespace blink
|
|
|