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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.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/ScriptPromisePropertyTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp
index 65c9393c3dd9ef5c32a8aaf2fa3d30165fe4203c..52af5edc000a6c2d26d5e4563c6f58122de5c3c1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp
@@ -281,7 +281,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, Resolve_ResolvesScriptPromise)
getProperty()->resolve(value);
EXPECT_EQ(Property::Resolved, getProperty()->getState());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nResolveCalls);
EXPECT_EQ(1u, nOtherResolveCalls);
EXPECT_EQ(wrap(mainWorld(), value), actual);
@@ -307,7 +307,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, ResolveAndGetPromiseOnOtherWor
getProperty()->resolve(value);
EXPECT_EQ(Property::Resolved, getProperty()->getState());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nResolveCalls);
EXPECT_EQ(0u, nOtherResolveCalls);
@@ -316,7 +316,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, ResolveAndGetPromiseOnOtherWor
otherPromise.then(stub(currentScriptState(), otherActual, nOtherResolveCalls), notReached(currentScriptState()));
}
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nResolveCalls);
EXPECT_EQ(1u, nOtherResolveCalls);
EXPECT_EQ(wrap(mainWorld(), value), actual);
@@ -343,7 +343,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reject_RejectsScriptPromise)
getProperty()->promise(otherWorld()).then(notReached(currentScriptState()), stub(currentScriptState(), otherActual, nOtherRejectCalls));
}
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nRejectCalls);
EXPECT_EQ(wrap(mainWorld(), reason), actual);
EXPECT_EQ(1u, nOtherRejectCalls);
@@ -374,7 +374,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, Resolve_DeadContext)
getProperty()->resolve(new GarbageCollectedScriptWrappable("value"));
EXPECT_EQ(Property::Pending, getProperty()->getState());
- v8::Isolate::GetCurrent()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(v8::Isolate::GetCurrent());
}
TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset)
@@ -405,7 +405,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset)
EXPECT_EQ(0u, nOldResolveCalls);
EXPECT_EQ(0u, nNewRejectCalls);
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nOldResolveCalls);
EXPECT_EQ(1u, nNewRejectCalls);
EXPECT_NE(oldPromise, newPromise);
@@ -445,7 +445,7 @@ TEST_F(ScriptPromisePropertyRefCountedTest, Resolve)
getProperty()->resolve(value.get());
EXPECT_EQ(Property::Resolved, getProperty()->getState());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nResolveCalls);
EXPECT_EQ(wrap(mainWorld(), value), actual);
}
@@ -464,7 +464,7 @@ TEST_F(ScriptPromisePropertyRefCountedTest, Reject)
getProperty()->reject(reason);
EXPECT_EQ(Property::Rejected, getProperty()->getState());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ(1u, nRejectCalls);
EXPECT_EQ(wrap(mainWorld(), reason), actual);
}
@@ -514,7 +514,7 @@ public:
property->promise(DOMWrapperWorld::mainWorld()).then(stub(currentScriptState(), actualValue, nResolveCalls), notReached(currentScriptState()));
}
property->resolve(value);
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
{
ScriptState::Scope scope(mainScriptState());
actual = toCoreString(actualValue.v8Value()->ToString(mainScriptState()->context()).ToLocalChecked());

Powered by Google App Engine
This is Rietveld 408576698