| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "public/web/WebDocument.h" | 7 #include "public/web/WebDocument.h" |
| 8 | 8 |
| 9 #include "core/CSSPropertyNames.h" | 9 #include "core/CSSPropertyNames.h" |
| 10 #include "core/dom/NodeRenderStyle.h" | 10 #include "core/dom/NodeRenderStyle.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 // Show transition elements | 176 // Show transition elements |
| 177 frame->document().showTransitionElements("#foo"); | 177 frame->document().showTransitionElements("#foo"); |
| 178 FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); | 178 FrameTestHelpers::pumpPendingRequestsDoNotUse(frame); |
| 179 coreDoc->updateRenderTreeIfNeeded(); | 179 coreDoc->updateRenderTreeIfNeeded(); |
| 180 transitionStyle = transitionElement->renderStyle(); | 180 transitionStyle = transitionElement->renderStyle(); |
| 181 ASSERT_TRUE(transitionStyle); | 181 ASSERT_TRUE(transitionStyle); |
| 182 EXPECT_EQ(transitionStyle->opacity(), 1); | 182 EXPECT_EQ(transitionStyle->opacity(), 1); |
| 183 } | 183 } |
| 184 | 184 |
| 185 |
| 186 TEST(WebDocumentTest, SetIsTransitionDocument) |
| 187 { |
| 188 std::string baseURL = "http://www.test.com:0/"; |
| 189 const char* htmlURL = "transition_exit.html"; |
| 190 const char* cssURL = "transition_exit.css"; |
| 191 URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + htmlURL), WebString::
fromUTF8(htmlURL)); |
| 192 URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + cssURL), WebString::f
romUTF8(cssURL)); |
| 193 |
| 194 WebViewHelper webViewHelper; |
| 195 webViewHelper.initializeAndLoad(baseURL + htmlURL); |
| 196 |
| 197 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 198 Document* coreDoc = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame())->document(); |
| 199 |
| 200 ASSERT_FALSE(coreDoc->isTransitionDocument()); |
| 201 |
| 202 frame->document().setIsTransitionDocument(true); |
| 203 ASSERT_TRUE(coreDoc->isTransitionDocument()); |
| 204 |
| 205 frame->document().setIsTransitionDocument(false); |
| 206 ASSERT_FALSE(coreDoc->isTransitionDocument()); |
| 185 } | 207 } |
| 208 |
| 209 } |
| OLD | NEW |