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 2cbe04647df76423697db029fa893b958c932f16..848d2ee68568faa92a07fe8d979e0c899c2b96d7 100644 |
--- a/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp |
+++ b/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp |
@@ -62,12 +62,6 @@ class PerformanceBaseTest : public ::testing::Test { |
return m_observer->m_performanceEntries.size(); |
} |
- PerformanceNavigationTiming::NavigationType getNavigationType( |
- NavigationType type, |
- Document* document) { |
- return PerformanceBase::getNavigationType(type, document); |
- } |
- |
static bool allowsTimingRedirect( |
const Vector<ResourceResponse>& redirectChain, |
const ResourceResponse& finalResponse, |
@@ -145,33 +139,12 @@ TEST_F(PerformanceBaseTest, AddLongTaskTiming) { |
EXPECT_EQ(1, numPerformanceEntriesInObserver()); // added an entry |
} |
-TEST_F(PerformanceBaseTest, GetNavigationType) { |
- m_pageHolder->page().setVisibilityState(PageVisibilityStatePrerender, false); |
- PerformanceNavigationTiming::NavigationType returnedType = |
- getNavigationType(NavigationTypeBackForward, &m_pageHolder->document()); |
- EXPECT_EQ(returnedType, |
- PerformanceNavigationTiming::NavigationType::Prerender); |
- |
- m_pageHolder->page().setVisibilityState(PageVisibilityStateHidden, false); |
- returnedType = |
- getNavigationType(NavigationTypeBackForward, &m_pageHolder->document()); |
- EXPECT_EQ(returnedType, |
- PerformanceNavigationTiming::NavigationType::BackForward); |
- |
- m_pageHolder->page().setVisibilityState(PageVisibilityStateVisible, false); |
- returnedType = getNavigationType(NavigationTypeFormResubmitted, |
- &m_pageHolder->document()); |
- EXPECT_EQ(returnedType, |
- PerformanceNavigationTiming::NavigationType::Navigate); |
-} |
- |
TEST_F(PerformanceBaseTest, AllowsTimingRedirect) { |
// When there are no cross-origin redirects. |
AtomicString originDomain = "http://127.0.0.1:8000"; |
Vector<ResourceResponse> redirectChain; |
KURL url(ParsedURLString, originDomain + "/foo.html"); |
ResourceResponse finalResponse; |
- finalResponse.setURL(url); |
ResourceResponse redirectResponse1; |
redirectResponse1.setURL(url); |
ResourceResponse redirectResponse2; |
@@ -179,6 +152,11 @@ TEST_F(PerformanceBaseTest, AllowsTimingRedirect) { |
redirectChain.push_back(redirectResponse1); |
redirectChain.push_back(redirectResponse2); |
RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(url); |
+ // When finalResponse is an empty object. |
+ EXPECT_FALSE(allowsTimingRedirect(redirectChain, finalResponse, |
+ *securityOrigin.get(), |
+ getExecutionContext())); |
+ finalResponse.setURL(url); |
EXPECT_TRUE(allowsTimingRedirect(redirectChain, finalResponse, |
*securityOrigin.get(), |
getExecutionContext())); |