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

Side by Side Diff: third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp

Issue 1397713004: Don't bother layout until first navigation is done. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another attempt to fix tests Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/Source/web/tests/TextFinderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698