Index: Source/web/tests/WebDocumentTest.cpp |
diff --git a/Source/web/tests/WebDocumentTest.cpp b/Source/web/tests/WebDocumentTest.cpp |
index 88a302b35508d2db0097a4e25683129f9d2a5b22..dae8d9b49c56c59fc59f33df599b331c340a723b 100644 |
--- a/Source/web/tests/WebDocumentTest.cpp |
+++ b/Source/web/tests/WebDocumentTest.cpp |
@@ -57,154 +57,6 @@ TEST(WebDocumentTest, InsertStyleSheet) |
ASSERT_EQ(Color(0, 128, 0), styleAfterInsertion.visitedDependentColor(CSSPropertyColor)); |
} |
-TEST(WebDocumentTest, BeginExitTransition) |
-{ |
- std::string baseURL = "http://www.test.com:0/"; |
- const char* htmlURL = "transition_exit.html"; |
- const char* cssURL = "transition_exit.css"; |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + htmlURL), WebString::fromUTF8(htmlURL)); |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + cssURL), WebString::fromUTF8(cssURL)); |
- |
- WebViewHelper webViewHelper; |
- webViewHelper.initializeAndLoad(baseURL + htmlURL); |
- |
- WebFrame* frame = webViewHelper.webView()->mainFrame(); |
- Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document(); |
- Element* transitionElement = coreDoc->getElementById("foo"); |
- ASSERT(transitionElement); |
- |
- const ComputedStyle* transitionStyle = transitionElement->computedStyle(); |
- ASSERT(transitionStyle); |
- |
- HTMLElement* bodyElement = coreDoc->body(); |
- ASSERT(bodyElement); |
- |
- const ComputedStyle* bodyStyle = bodyElement->computedStyle(); |
- ASSERT(bodyStyle); |
- // The transition_exit.css stylesheet should not have been applied at this point. |
- ASSERT_EQ(Color(0, 0, 0), bodyStyle->visitedDependentColor(CSSPropertyColor)); |
- |
- frame->document().beginExitTransition("#foo", false); |
- |
- // Make sure the stylesheet load request gets processed. |
- FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); |
- coreDoc->updateLayoutTreeIfNeeded(); |
- |
- // The element should now be hidden. |
- transitionStyle = transitionElement->computedStyle(); |
- ASSERT_TRUE(transitionStyle); |
- ASSERT_EQ(transitionStyle->opacity(), 0); |
- |
- // The stylesheet should now have been applied. |
- bodyStyle = bodyElement->computedStyle(); |
- ASSERT(bodyStyle); |
- ASSERT_EQ(Color(0, 128, 0), bodyStyle->visitedDependentColor(CSSPropertyColor)); |
-} |
- |
- |
-TEST(WebDocumentTest, BeginExitTransitionToNativeApp) |
-{ |
- std::string baseURL = "http://www.test.com:0/"; |
- const char* htmlURL = "transition_exit.html"; |
- const char* cssURL = "transition_exit.css"; |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + htmlURL), WebString::fromUTF8(htmlURL)); |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + cssURL), WebString::fromUTF8(cssURL)); |
- |
- WebViewHelper webViewHelper; |
- webViewHelper.initializeAndLoad(baseURL + htmlURL); |
- |
- WebFrame* frame = webViewHelper.webView()->mainFrame(); |
- Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document(); |
- Element* transitionElement = coreDoc->getElementById("foo"); |
- ASSERT(transitionElement); |
- |
- const ComputedStyle* transitionStyle = transitionElement->computedStyle(); |
- ASSERT(transitionStyle); |
- |
- HTMLElement* bodyElement = coreDoc->body(); |
- ASSERT(bodyElement); |
- |
- const ComputedStyle* bodyStyle = bodyElement->computedStyle(); |
- ASSERT(bodyStyle); |
- // The transition_exit.css stylesheet should not have been applied at this point. |
- ASSERT_EQ(Color(0, 0, 0), bodyStyle->visitedDependentColor(CSSPropertyColor)); |
- |
- frame->document().beginExitTransition("#foo", true); |
- |
- // Make sure the stylesheet load request gets processed. |
- FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); |
- coreDoc->updateLayoutTreeIfNeeded(); |
- |
- // The element should not be hidden. |
- transitionStyle = transitionElement->computedStyle(); |
- ASSERT_TRUE(transitionStyle); |
- ASSERT_EQ(transitionStyle->opacity(), 1); |
- |
- // The stylesheet should now have been applied. |
- bodyStyle = bodyElement->computedStyle(); |
- ASSERT(bodyStyle); |
- ASSERT_EQ(Color(0, 128, 0), bodyStyle->visitedDependentColor(CSSPropertyColor)); |
-} |
- |
- |
-TEST(WebDocumentTest, HideAndShowTransitionElements) |
-{ |
- std::string baseURL = "http://www.test.com:0/"; |
- const char* htmlURL = "transition_hide_and_show.html"; |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + htmlURL), WebString::fromUTF8(htmlURL)); |
- |
- WebViewHelper webViewHelper; |
- webViewHelper.initializeAndLoad(baseURL + htmlURL); |
- |
- WebFrame* frame = webViewHelper.webView()->mainFrame(); |
- Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document(); |
- Element* transitionElement = coreDoc->getElementById("foo"); |
- ASSERT(transitionElement); |
- |
- const ComputedStyle* transitionStyle = transitionElement->computedStyle(); |
- ASSERT(transitionStyle); |
- EXPECT_EQ(transitionStyle->opacity(), 1); |
- |
- // Hide transition elements |
- frame->document().hideTransitionElements("#foo"); |
- FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); |
- coreDoc->updateLayoutTreeIfNeeded(); |
- transitionStyle = transitionElement->computedStyle(); |
- ASSERT_TRUE(transitionStyle); |
- EXPECT_EQ(transitionStyle->opacity(), 0); |
- |
- // Show transition elements |
- frame->document().showTransitionElements("#foo"); |
- FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); |
- coreDoc->updateLayoutTreeIfNeeded(); |
- transitionStyle = transitionElement->computedStyle(); |
- ASSERT_TRUE(transitionStyle); |
- EXPECT_EQ(transitionStyle->opacity(), 1); |
-} |
- |
- |
-TEST(WebDocumentTest, SetIsTransitionDocument) |
-{ |
- std::string baseURL = "http://www.test.com:0/"; |
- const char* htmlURL = "transition_exit.html"; |
- const char* cssURL = "transition_exit.css"; |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + htmlURL), WebString::fromUTF8(htmlURL)); |
- URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + cssURL), WebString::fromUTF8(cssURL)); |
- |
- WebViewHelper webViewHelper; |
- webViewHelper.initializeAndLoad(baseURL + htmlURL); |
- |
- WebFrame* frame = webViewHelper.webView()->mainFrame(); |
- Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document(); |
- |
- ASSERT_FALSE(coreDoc->isTransitionDocument()); |
- |
- frame->document().setIsTransitionDocument(true); |
- ASSERT_TRUE(coreDoc->isTransitionDocument()); |
- |
- frame->document().setIsTransitionDocument(false); |
- ASSERT_FALSE(coreDoc->isTransitionDocument()); |
-} |
namespace { |
const char* baseURLOriginA = "http://example.test:0/"; |