| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/html/HTMLIFrameElement.h" | 9 #include "core/html/HTMLIFrameElement.h" |
| 10 #include "platform/graphics/test/FakeGraphicsLayerFactory.h" | 10 #include "platform/graphics/test/FakeGraphicsLayerFactory.h" |
| 11 #include "platform/scroll/ScrollbarTheme.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 class FakeChromeClient : public EmptyChromeClient { | 17 class FakeChromeClient : public EmptyChromeClient { |
| 17 public: | 18 public: |
| 18 static PassOwnPtrWillBeRawPtr<FakeChromeClient> create() { return adoptPtrWi
llBeNoop(new FakeChromeClient); } | 19 static PassOwnPtrWillBeRawPtr<FakeChromeClient> create() { return adoptPtrWi
llBeNoop(new FakeChromeClient); } |
| 19 | 20 |
| 20 GraphicsLayerFactory* graphicsLayerFactory() const override | 21 GraphicsLayerFactory* graphicsLayerFactory() const override |
| 21 { | 22 { |
| 22 return FakeGraphicsLayerFactory::instance(); | 23 return FakeGraphicsLayerFactory::instance(); |
| 23 } | 24 } |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 } // namespace | 27 } // namespace |
| 27 | 28 |
| 28 RenderingTest::RenderingTest(PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoad
erClient) | 29 RenderingTest::RenderingTest(PassOwnPtrWillBeRawPtr<FrameLoaderClient> frameLoad
erClient) |
| 29 { | 30 { |
| 30 Page::PageClients pageClients; | 31 Page::PageClients pageClients; |
| 31 fillWithEmptyClients(pageClients); | 32 fillWithEmptyClients(pageClients); |
| 32 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FakeChromeClient>, chromeClient,
(FakeChromeClient::create())); | 33 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FakeChromeClient>, chromeClient,
(FakeChromeClient::create())); |
| 33 pageClients.chromeClient = chromeClient.get(); | 34 pageClients.chromeClient = chromeClient.get(); |
| 34 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, fram
eLoaderClient, settingOverrider()); | 35 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, fram
eLoaderClient, settingOverrider()); |
| 36 |
| 37 Settings::setMockScrollbarsEnabled(true); |
| 38 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); |
| 39 EXPECT_TRUE(ScrollbarTheme::theme().usesOverlayScrollbars()); |
| 35 } | 40 } |
| 36 | 41 |
| 37 void RenderingTest::SetUp() | 42 void RenderingTest::SetUp() |
| 38 { | 43 { |
| 39 // This ensures that the minimal DOM tree gets attached | 44 // This ensures that the minimal DOM tree gets attached |
| 40 // correctly for tests that don't call setBodyInnerHTML. | 45 // correctly for tests that don't call setBodyInnerHTML. |
| 41 document().view()->updateAllLifecyclePhases(); | 46 document().view()->updateAllLifecyclePhases(); |
| 42 } | 47 } |
| 43 | 48 |
| 44 void RenderingTest::TearDown() | 49 void RenderingTest::TearDown() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 66 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se
tChild(m_subframe.get()); | 71 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se
tChild(m_subframe.get()); |
| 67 document().frame()->host()->incrementSubframeCount(); | 72 document().frame()->host()->incrementSubframeCount(); |
| 68 Document& frameDocument = *iframe.contentDocument(); | 73 Document& frameDocument = *iframe.contentDocument(); |
| 69 | 74 |
| 70 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); | 75 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
| 71 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION)
; | 76 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION)
; |
| 72 return frameDocument; | 77 return frameDocument; |
| 73 } | 78 } |
| 74 | 79 |
| 75 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |