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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp

Issue 2641173008: [SPv2] Add CSS mask support (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
index 06ccad5ce8ecced663480da4a992f7ba31e06e72..3ac6e59a1e366211664add55b3248f0d20209767 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
@@ -4,10 +4,15 @@
#include "core/layout/LayoutTestHelper.h"
+#include "bindings/core/v8/StringOrArrayBufferOrArrayBufferView.h"
+#include "core/css/FontFaceDescriptors.h"
+#include "core/css/FontFaceSet.h"
+#include "core/dom/DOMArrayBuffer.h"
#include "core/frame/FrameHost.h"
#include "core/html/HTMLIFrameElement.h"
#include "platform/loader/fetch/MemoryCache.h"
#include "platform/scroll/ScrollbarTheme.h"
+#include "platform/testing/UnitTestHelpers.h"
namespace blink {
@@ -71,4 +76,19 @@ void RenderingTest::setChildFrameHTML(const String& html) {
childDocument().body()->setInnerHTML(html, ASSERT_NO_EXCEPTION);
}
+void RenderingTest::loadAhem() {
+ RefPtr<SharedBuffer> sharedBuffer =
+ testing::readFromFile(testing::webTestDataPath("Ahem.ttf"));
+ StringOrArrayBufferOrArrayBufferView buffer =
+ StringOrArrayBufferOrArrayBufferView::fromArrayBuffer(
+ DOMArrayBuffer::create(sharedBuffer->data(), sharedBuffer->size()));
+ FontFace* ahem =
+ FontFace::create(&document(), "Ahem", buffer, FontFaceDescriptors());
+
+ ScriptState* scriptState = ScriptState::forMainWorld(&m_pageHolder->frame());
+ DummyExceptionStateForTesting exceptionState;
+ FontFaceSet::from(document())
+ ->addForBinding(scriptState, ahem, exceptionState);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698