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

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

Issue 723073003: Navigation transitions (web to native app): Bug fix for hide/Show transition elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review fix Created 6 years, 1 month 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/WebDocument.cpp ('k') | Source/web/tests/data/transition_hide_and_show.html » ('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 a14858f2e8d7d616e65562543c5b395b9b6bd16a..2095b1dbe0800e34629c686139dae4754ca78956 100644
--- a/Source/web/tests/WebDocumentTest.cpp
+++ b/Source/web/tests/WebDocumentTest.cpp
@@ -101,4 +101,40 @@ TEST(WebDocumentTest, BeginExitTransition)
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);
+
+ RenderStyle* transitionStyle = transitionElement->renderStyle();
+ ASSERT(transitionStyle);
+ EXPECT_EQ(transitionStyle->opacity(), 1);
+
+ // Hide transition elements
+ frame->document().hideTransitionElements("#foo");
+ FrameTestHelpers::pumpPendingRequestsDoNotUse(frame);
+ coreDoc->updateRenderTreeIfNeeded();
+ transitionStyle = transitionElement->renderStyle();
+ ASSERT_TRUE(transitionStyle);
+ EXPECT_EQ(transitionStyle->opacity(), 0);
+
+ // Show transition elements
+ frame->document().showTransitionElements("#foo");
+ FrameTestHelpers::pumpPendingRequestsDoNotUse(frame);
+ coreDoc->updateRenderTreeIfNeeded();
+ transitionStyle = transitionElement->renderStyle();
+ ASSERT_TRUE(transitionStyle);
+ EXPECT_EQ(transitionStyle->opacity(), 1);
+}
+
}
« no previous file with comments | « Source/web/WebDocument.cpp ('k') | Source/web/tests/data/transition_hide_and_show.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698