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

Unified Diff: Source/core/rendering/RenderingTestHelper.cpp

Issue 702633002: Move ViewDisplayList to GraphicsLayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: copy & pasted test expectation from the wrong window. sorry. :( Created 6 years, 1 month 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
Index: Source/core/rendering/RenderingTestHelper.cpp
diff --git a/Source/core/rendering/RenderingTestHelper.cpp b/Source/core/rendering/RenderingTestHelper.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..86b8f6a2c56a6d3db49024489b684e99734ade80
--- /dev/null
+++ b/Source/core/rendering/RenderingTestHelper.cpp
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/rendering/RenderingTestHelper.h"
+
+#include "core/loader/EmptyClients.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/GraphicsLayerFactory.h"
+
+namespace blink {
+
+class FakeGraphicsLayerFactory : public GraphicsLayerFactory {
+public:
+ virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient* client) override
+ {
+ return adoptPtr(new GraphicsLayer(client));
+ }
+};
+
+class FakeChromeClient : public EmptyChromeClient {
+public:
+ virtual GraphicsLayerFactory* graphicsLayerFactory() const
+ {
+ static FakeGraphicsLayerFactory* factory = adoptPtr(new FakeGraphicsLayerFactory).leakPtr();
+ return factory;
+ }
+};
+
+void RenderingTest::SetUp()
+{
+ fillWithEmptyClients(m_pageClients);
+ static FakeChromeClient* chromeClient = adoptPtr(new FakeChromeClient).leakPtr();
+ m_pageClients.chromeClient = chromeClient;
+ m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &m_pageClients);
+
+ document().settings()->setRegionBasedColumnsEnabled(true);
+
+ // This ensures that the minimal DOM tree gets attached
+ // correctly for tests that don't call setBodyInnerHTML.
+ document().view()->updateLayoutAndStyleIfNeededRecursive();
+}
+
+
+} // namespace blink
« no previous file with comments | « Source/core/rendering/RenderingTestHelper.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698