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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp

Issue 1810853002: Blink Platform: Erase GraphicsLayerFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layout/LayoutTestHelper.h" 5 #include "core/layout/LayoutTestHelper.h"
6 6
7 #include "core/frame/FrameHost.h" 7 #include "core/frame/FrameHost.h"
8 #include "core/html/HTMLIFrameElement.h" 8 #include "core/html/HTMLIFrameElement.h"
9 #include "platform/graphics/test/FakeGraphicsLayerFactory.h"
10 #include "platform/scroll/ScrollbarTheme.h" 9 #include "platform/scroll/ScrollbarTheme.h"
11 10
12 namespace blink { 11 namespace blink {
13 12
14 namespace {
15
16 class FakeChromeClient : public EmptyChromeClient {
17 public:
18 static PassOwnPtrWillBeRawPtr<FakeChromeClient> create() { return adoptPtrWi llBeNoop(new FakeChromeClient); }
19
20 GraphicsLayerFactory* graphicsLayerFactory() const override
21 {
22 return FakeGraphicsLayerFactory::instance();
23 }
24 };
25
26 } // namespace
27
28 RenderingTest::RenderingTest(PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoad erClient) 13 RenderingTest::RenderingTest(PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoad erClient)
29 : m_frameLoaderClient(frameLoaderClient) { } 14 : m_frameLoaderClient(frameLoaderClient) { }
30 15
31 void RenderingTest::SetUp() 16 void RenderingTest::SetUp()
32 { 17 {
33 Page::PageClients pageClients; 18 Page::PageClients pageClients;
34 fillWithEmptyClients(pageClients); 19 fillWithEmptyClients(pageClients);
35 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FakeChromeClient>, chromeClient, (FakeChromeClient::create())); 20 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<EmptyChromeClient>, chromeClient, (EmptyChromeClient::create()));
36 pageClients.chromeClient = chromeClient.get(); 21 pageClients.chromeClient = chromeClient.get();
37 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, m_fr ameLoaderClient.release(), settingOverrider()); 22 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, m_fr ameLoaderClient.release(), settingOverrider());
38 23
39 Settings::setMockScrollbarsEnabled(true); 24 Settings::setMockScrollbarsEnabled(true);
40 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); 25 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
41 EXPECT_TRUE(ScrollbarTheme::theme().usesOverlayScrollbars()); 26 EXPECT_TRUE(ScrollbarTheme::theme().usesOverlayScrollbars());
42 27
43 // This ensures that the minimal DOM tree gets attached 28 // This ensures that the minimal DOM tree gets attached
44 // correctly for tests that don't call setBodyInnerHTML. 29 // correctly for tests that don't call setBodyInnerHTML.
45 document().view()->updateAllLifecyclePhases(); 30 document().view()->updateAllLifecyclePhases();
(...skipping 28 matching lines...) Expand all
74 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se tChild(m_subframe.get()); 59 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se tChild(m_subframe.get());
75 document().frame()->host()->incrementSubframeCount(); 60 document().frame()->host()->incrementSubframeCount();
76 Document& frameDocument = *iframe.contentDocument(); 61 Document& frameDocument = *iframe.contentDocument();
77 62
78 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); 63 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com"));
79 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION) ; 64 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION) ;
80 return frameDocument; 65 return frameDocument;
81 } 66 }
82 67
83 } // namespace blink 68 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698