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

Unified Diff: Source/web/tests/WebDocumentTest.cpp

Issue 1140153006: Remove Navigation Transitions from Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed layout tests. Created 5 years, 7 months 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
« no previous file with comments | « Source/web/WebRuntimeFeatures.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/";
« no previous file with comments | « Source/web/WebRuntimeFeatures.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698