| 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 "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/StringOrArrayBufferOrArrayBufferView.h" | 7 #include "bindings/core/v8/StringOrArrayBufferOrArrayBufferView.h" |
| 8 #include "core/css/FontFaceDescriptors.h" | 8 #include "core/css/FontFaceDescriptors.h" |
| 9 #include "core/css/FontFaceSet.h" | 9 #include "core/css/FontFaceSet.h" |
| 10 #include "core/dom/DOMArrayBuffer.h" | 10 #include "core/dom/DOMArrayBuffer.h" |
| 11 #include "core/html/HTMLIFrameElement.h" | 11 #include "core/html/HTMLIFrameElement.h" |
| 12 #include "platform/loader/fetch/MemoryCache.h" | 12 #include "platform/loader/fetch/MemoryCache.h" |
| 13 #include "platform/scroll/ScrollbarTheme.h" | 13 #include "platform/scroll/ScrollbarTheme.h" |
| 14 #include "platform/testing/UnitTestHelpers.h" | 14 #include "platform/testing/UnitTestHelpers.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 LocalFrame* SingleChildLocalFrameClient::createFrame( | 18 LocalFrame* SingleChildLocalFrameClient::createFrame( |
| 19 const FrameLoadRequest&, | 19 const FrameLoadRequest&, |
| 20 const AtomicString& name, | 20 const AtomicString& name, |
| 21 HTMLFrameOwnerElement* ownerElement) { | 21 HTMLFrameOwnerElement* ownerElement) { |
| 22 DCHECK(!m_child) << "This test helper only supports one child frame."; | 22 DCHECK(!m_child) << "This test helper only supports one child frame."; |
| 23 | 23 |
| 24 LocalFrame* parentFrame = ownerElement->document().frame(); | 24 LocalFrame* parentFrame = ownerElement->document().frame(); |
| 25 auto* childClient = LocalFrameClientWithParent::create(parentFrame); | 25 auto* childClient = LocalFrameClientWithParent::create(parentFrame); |
| 26 m_child = LocalFrame::create(childClient, *parentFrame->page(), ownerElement); | 26 m_child = LocalFrame::create(childClient, *parentFrame->page(), ownerElement); |
| 27 m_child->createView(IntSize(500, 500), Color(), true /* transparent */); | 27 m_child->createView(IntSize(500, 500), Color::transparent); |
| 28 m_child->init(); | 28 m_child->init(); |
| 29 | 29 |
| 30 return m_child.get(); | 30 return m_child.get(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void LocalFrameClientWithParent::detached(FrameDetachType) { | 33 void LocalFrameClientWithParent::detached(FrameDetachType) { |
| 34 static_cast<SingleChildLocalFrameClient*>(parent()->client()) | 34 static_cast<SingleChildLocalFrameClient*>(parent()->client()) |
| 35 ->didDetachChild(); | 35 ->didDetachChild(); |
| 36 } | 36 } |
| 37 | 37 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 FontFace* ahem = | 84 FontFace* ahem = |
| 85 FontFace::create(&document(), "Ahem", buffer, FontFaceDescriptors()); | 85 FontFace::create(&document(), "Ahem", buffer, FontFaceDescriptors()); |
| 86 | 86 |
| 87 ScriptState* scriptState = ScriptState::forMainWorld(&m_pageHolder->frame()); | 87 ScriptState* scriptState = ScriptState::forMainWorld(&m_pageHolder->frame()); |
| 88 DummyExceptionStateForTesting exceptionState; | 88 DummyExceptionStateForTesting exceptionState; |
| 89 FontFaceSet::from(document()) | 89 FontFaceSet::from(document()) |
| 90 ->addForBinding(scriptState, ahem, exceptionState); | 90 ->addForBinding(scriptState, ahem, exceptionState); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |