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

Side by Side Diff: third_party/WebKit/Source/core/testing/DummyPageHolder.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, 9 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 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "core/testing/DummyPageHolder.h" 31 #include "core/testing/DummyPageHolder.h"
32 32
33 #include "core/frame/FrameHost.h" 33 #include "core/frame/FrameHost.h"
34 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
35 #include "core/frame/LocalDOMWindow.h" 35 #include "core/frame/LocalDOMWindow.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/loader/EmptyClients.h" 38 #include "core/loader/EmptyClients.h"
39 #include "core/loader/FrameLoaderStateMachine.h"
39 #include "wtf/Assertions.h" 40 #include "wtf/Assertions.h"
40 41
41 namespace blink { 42 namespace blink {
42 43
43 void RootLayerScrollsFrameSettingOverride(Settings& settings) 44 void RootLayerScrollsFrameSettingOverride(Settings& settings)
44 { 45 {
45 settings.setRootLayerScrolls(true); 46 settings.setRootLayerScrolls(true);
46 } 47 }
47 48
48 PassOwnPtr<DummyPageHolder> DummyPageHolder::create( 49 PassOwnPtr<DummyPageHolder> DummyPageHolder::create(
(...skipping 29 matching lines...) Expand all
78 (*settingOverrider)(settings); 79 (*settingOverrider)(settings);
79 80
80 m_frameLoaderClient = frameLoaderClient; 81 m_frameLoaderClient = frameLoaderClient;
81 if (!m_frameLoaderClient) 82 if (!m_frameLoaderClient)
82 m_frameLoaderClient = EmptyFrameLoaderClient::create(); 83 m_frameLoaderClient = EmptyFrameLoaderClient::create();
83 84
84 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost() , 0); 85 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost() , 0);
85 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); 86 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize));
86 m_frame->view()->page()->frameHost().visualViewport().setSize(initialViewSiz e); 87 m_frame->view()->page()->frameHost().visualViewport().setSize(initialViewSiz e);
87 m_frame->init(); 88 m_frame->init();
89 // Some tests directly inject content into the initial empty document.
90 // Unmark it so that unforced layout would also run on the document.
91 m_frame->loader().stateMachine()->advanceTo(FrameLoaderStateMachine::Committ edFirstRealLoad);
88 } 92 }
89 93
90 DummyPageHolder::~DummyPageHolder() 94 DummyPageHolder::~DummyPageHolder()
91 { 95 {
92 m_page->willBeDestroyed(); 96 m_page->willBeDestroyed();
93 m_page.clear(); 97 m_page.clear();
94 m_frame.clear(); 98 m_frame.clear();
95 } 99 }
96 100
97 Page& DummyPageHolder::page() const 101 Page& DummyPageHolder::page() const
(...skipping 11 matching lines...) Expand all
109 { 113 {
110 return *m_frame->view(); 114 return *m_frame->view();
111 } 115 }
112 116
113 Document& DummyPageHolder::document() const 117 Document& DummyPageHolder::document() const
114 { 118 {
115 return *m_frame->domWindow()->document(); 119 return *m_frame->domWindow()->document();
116 } 120 }
117 121
118 } // namespace blink 122 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp ('k') | third_party/WebKit/Source/web/WebFrameContentDumper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698