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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp

Issue 1743763004: Use v8::MicrotasksScope internally in V8RecursionScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8rs-2-endofscope
Patch Set: v8_helpers 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
index 3a68a79691b79b488033b24542e14a7f1f1504d2..ba889fef8d8436b41bc85f095aa72ac330b0abc2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
@@ -12,6 +12,7 @@
#include "bindings/core/v8/V8BindingForTesting.h"
#include "bindings/core/v8/V8BindingMacros.h"
#include "bindings/core/v8/V8IteratorResultValue.h"
+#include "bindings/core/v8/V8RecursionScope.h"
#include "bindings/core/v8/V8ThrowException.h"
#include "core/dom/Document.h"
#include "core/streams/ReadableStreamController.h"
@@ -138,7 +139,7 @@ public:
~ReadableStreamOperationsTest() override
{
// Execute all pending microtasks
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_FALSE(m_block.HasCaught());
}
@@ -149,6 +150,7 @@ public:
{
v8::Local<v8::String> source;
v8::Local<v8::Script> script;
+ V8RecursionScope::MicrotaskSuppression microtasks(isolate());
if (!v8Call(v8::String::NewFromUtf8(isolate(), s, v8::NewStringType::kNormal), source)) {
ADD_FAILURE();
return ScriptValue();
@@ -253,12 +255,12 @@ TEST_F(ReadableStreamOperationsTest, Read)
Function::createFunction(getScriptState(), it2),
NotReached::createFunction(getScriptState()));
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_FALSE(it1->isSet());
EXPECT_FALSE(it2->isSet());
ASSERT_FALSE(evalWithPrintingError("controller.enqueue('hello')").isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(it1->isSet());
EXPECT_TRUE(it1->isValid());
EXPECT_FALSE(it1->isDone());
@@ -266,7 +268,7 @@ TEST_F(ReadableStreamOperationsTest, Read)
EXPECT_FALSE(it2->isSet());
ASSERT_FALSE(evalWithPrintingError("controller.close()").isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(it1->isSet());
EXPECT_TRUE(it1->isValid());
EXPECT_FALSE(it1->isDone());
@@ -309,7 +311,7 @@ TEST_F(ReadableStreamOperationsTest, CreateReadableStreamWithCustomUnderlyingSou
ReadableStreamOperations::read(getScriptState(), reader).then(Function::createFunction(getScriptState(), it2), NotReached::createFunction(getScriptState()));
ReadableStreamOperations::read(getScriptState(), reader).then(Function::createFunction(getScriptState(), it3), NotReached::createFunction(getScriptState()));
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(10, underlyingSource->desiredSize());
@@ -326,7 +328,7 @@ TEST_F(ReadableStreamOperationsTest, CreateReadableStreamWithCustomUnderlyingSou
EXPECT_FALSE(it3->isSet());
underlyingSource->close();
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(it3->isSet());
EXPECT_TRUE(it3->isValid());
« no previous file with comments | « gin/run_microtasks_observer.cc ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698