| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/html/HTMLIFrameElement.h" | 6 #include "core/html/HTMLIFrameElement.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "web/tests/sim/SimCompositor.h" | 8 #include "web/tests/sim/SimCompositor.h" |
| 9 #include "web/tests/sim/SimDisplayItemList.h" | 9 #include "web/tests/sim/SimDisplayItemList.h" |
| 10 #include "web/tests/sim/SimRequest.h" | 10 #include "web/tests/sim/SimRequest.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // paint invalidation for every layer since frame2 painted them but skipped | 284 // paint invalidation for every layer since frame2 painted them but skipped |
| 285 // painting the real content to avoid FOUC. | 285 // painting the real content to avoid FOUC. |
| 286 cssResource.complete(); | 286 cssResource.complete(); |
| 287 | 287 |
| 288 // First frame where all frames are loaded, should paint the text in the | 288 // First frame where all frames are loaded, should paint the text in the |
| 289 // child frame. | 289 // child frame. |
| 290 auto frame3 = compositor().beginFrame(); | 290 auto frame3 = compositor().beginFrame(); |
| 291 EXPECT_TRUE(frame3.containsText()); | 291 EXPECT_TRUE(frame3.containsText()); |
| 292 } | 292 } |
| 293 | 293 |
| 294 TEST_F(DocumentLoadingRenderingTest, ShouldNotLayoutBeforeNavigation) |
| 295 { |
| 296 EXPECT_TRUE(compositor().deferCommits()); |
| 297 EXPECT_FALSE(hadFirstLayout()); |
| 298 |
| 299 // Blink embedder may resize the WebView before navigation, but it shouldn't |
| 300 // trigger empty layout. |
| 301 webView().resize(WebSize(800, 600)); |
| 302 EXPECT_TRUE(compositor().deferCommits()); |
| 303 EXPECT_FALSE(hadFirstLayout()); |
| 304 |
| 305 // Blink embedder may set focus on the WebView before navigation, |
| 306 // but it shouldn't trigger empty layout. |
| 307 webView().setFocus(true); |
| 308 EXPECT_TRUE(compositor().deferCommits()); |
| 309 EXPECT_FALSE(hadFirstLayout()); |
| 310 } |
| 311 |
| 294 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |