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

Unified Diff: Source/core/testing/DummyPageHolder.cpp

Issue 467943005: Allow passing mock FrameLoaderClient to DummyPageHolder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/testing/DummyPageHolder.h ('k') | Source/modules/websockets/DOMWebSocketTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/DummyPageHolder.cpp
diff --git a/Source/core/testing/DummyPageHolder.cpp b/Source/core/testing/DummyPageHolder.cpp
index 78401b21b6f2b9c19e343c52ef350310d66d0253..cee64beb28995ab9cb3d8f93b22a1fe88bfd7c01 100644
--- a/Source/core/testing/DummyPageHolder.cpp
+++ b/Source/core/testing/DummyPageHolder.cpp
@@ -35,16 +35,22 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/loader/EmptyClients.h"
#include "wtf/Assertions.h"
namespace blink {
-PassOwnPtr<DummyPageHolder> DummyPageHolder::create(const IntSize& initialViewSize, Page::PageClients* pageClients)
-{
- return adoptPtr(new DummyPageHolder(initialViewSize, pageClients));
+PassOwnPtr<DummyPageHolder> DummyPageHolder::create(
+ const IntSize& initialViewSize,
+ Page::PageClients* pageClients,
+ PassOwnPtr<FrameLoaderClient> frameLoaderClient) {
+ return adoptPtr(new DummyPageHolder(initialViewSize, pageClients, frameLoaderClient));
}
-DummyPageHolder::DummyPageHolder(const IntSize& initialViewSize, Page::PageClients* pageClients)
+DummyPageHolder::DummyPageHolder(
+ const IntSize& initialViewSize,
+ Page::PageClients* pageClients,
+ PassOwnPtr<FrameLoaderClient> frameLoaderClient)
{
if (!pageClients) {
fillWithEmptyClients(m_pageClients);
@@ -64,7 +70,11 @@ DummyPageHolder::DummyPageHolder(const IntSize& initialViewSize, Page::PageClien
// not create graphics layers.
settings.setAcceleratedCompositingEnabled(false);
- m_frame = LocalFrame::create(&m_frameLoaderClient, &m_page->frameHost(), 0);
+ m_frameLoaderClient = frameLoaderClient;
+ if (!m_frameLoaderClient)
+ m_frameLoaderClient = adoptPtr(new EmptyFrameLoaderClient);
+
+ m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost(), 0);
m_frame->setView(FrameView::create(m_frame.get(), initialViewSize));
m_frame->init();
}
« no previous file with comments | « Source/core/testing/DummyPageHolder.h ('k') | Source/modules/websockets/DOMWebSocketTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698