| Index: Source/core/testing/Internals.cpp
|
| diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
|
| index 6f84a6b09302e5d3bf85f6c02a28aae1307d399a..069b81257db6df3e52063db3a75c2337321c89da 100644
|
| --- a/Source/core/testing/Internals.cpp
|
| +++ b/Source/core/testing/Internals.cpp
|
| @@ -117,6 +117,7 @@
|
| #include "core/paint/DeprecatedPaintLayer.h"
|
| #include "core/plugins/testing/DictionaryPluginPlaceholder.h"
|
| #include "core/plugins/testing/DocumentFragmentPluginPlaceholder.h"
|
| +#include "core/streams/ReadableStream2.h"
|
| #include "core/testing/DictionaryTest.h"
|
| #include "core/testing/GCObservation.h"
|
| #include "core/testing/InternalRuntimeFlags.h"
|
| @@ -192,9 +193,9 @@ static SpellCheckRequester* spellCheckRequester(Document* document)
|
|
|
| const char* Internals::internalsId = "internals";
|
|
|
| -Internals* Internals::create(Document* document)
|
| +Internals* Internals::create(ScriptState* scriptState)
|
| {
|
| - return new Internals(document);
|
| + return new Internals(scriptState);
|
| }
|
|
|
| Internals::~Internals()
|
| @@ -220,9 +221,26 @@ void Internals::resetToConsistentState(Page* page)
|
| page->deprecatedLocalMainFrame()->view()->clear();
|
| }
|
|
|
| -Internals::Internals(Document* document)
|
| - : ContextLifecycleObserver(document)
|
| +namespace {
|
| +
|
| +class TestUnderlyingSource : public UnderlyingSourceBase {
|
| +public:
|
| + ScriptPromise start(ScriptState* scriptState) override
|
| + {
|
| + controller().enqueue("a");
|
| + controller().enqueue("b");
|
| + controller().close();
|
| + return UnderlyingSourceBase::start(scriptState);
|
| + };
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +Internals::Internals(ScriptState* scriptState)
|
| + : ContextLifecycleObserver(scriptState->executionContext())
|
| , m_runtimeFlags(InternalRuntimeFlags::create())
|
| + , m_readableStream(new ReadableStream2(scriptState, new TestUnderlyingSource(),
|
| + ReadableStream2::createCountQueuingStrategy(scriptState, 1024.0)))
|
| {
|
| }
|
|
|
| @@ -2370,4 +2388,9 @@ ClientRectList* Internals::focusRingRects(Element* element)
|
| return ClientRectList::create(rects);
|
| }
|
|
|
| +ScriptValue Internals::readableStream()
|
| +{
|
| + return m_readableStream->scriptValue();
|
| +}
|
| +
|
| } // namespace blink
|
|
|