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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.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/ScriptPromiseTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
index a537ddc8e22e7d69b6758497dd4094f29c33b802..73b38ba071b29bdf62a51d83ba4b120527baee5a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
@@ -83,7 +83,7 @@ public:
createClosure(callback, v8::Undefined(m_scope.isolate()), m_scope.isolate());
// Execute all pending microtasks
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
}
String toString(const ScriptValue& value)
@@ -124,13 +124,13 @@ TEST_F(ScriptPromiseTest, thenResolve)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
resolver.resolve(v8String(isolate(), "hello"));
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ("hello", toString(onFulfilled));
EXPECT_TRUE(onRejected.isEmpty());
@@ -148,7 +148,7 @@ TEST_F(ScriptPromiseTest, resolveThen)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ("hello", toString(onFulfilled));
EXPECT_TRUE(onRejected.isEmpty());
@@ -165,13 +165,13 @@ TEST_F(ScriptPromiseTest, thenReject)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
resolver.reject(v8String(isolate(), "hello"));
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_EQ("hello", toString(onRejected));
@@ -189,7 +189,7 @@ TEST_F(ScriptPromiseTest, rejectThen)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_EQ("hello", toString(onRejected));
@@ -226,7 +226,7 @@ TEST_F(ScriptPromiseTest, castNonPromise)
EXPECT_TRUE(onRejected1.isEmpty());
EXPECT_TRUE(onRejected2.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_EQ("hello", toString(onFulfilled1));
EXPECT_EQ("hello", toString(onFulfilled2));
@@ -248,7 +248,7 @@ TEST_F(ScriptPromiseTest, reject)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_EQ("hello", toString(onRejected));
@@ -264,7 +264,7 @@ TEST_F(ScriptPromiseTest, rejectWithExceptionState)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_EQ("SyntaxError: some syntax error", toString(onRejected));
@@ -282,7 +282,7 @@ TEST_F(ScriptPromiseTest, allWithEmptyPromises)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_FALSE(onFulfilled.isEmpty());
EXPECT_TRUE(toStringArray(onFulfilled).isEmpty());
@@ -304,7 +304,7 @@ TEST_F(ScriptPromiseTest, allWithResolvedPromises)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_FALSE(onFulfilled.isEmpty());
Vector<String> values = toStringArray(onFulfilled);
@@ -329,7 +329,7 @@ TEST_F(ScriptPromiseTest, allWithRejectedPromise)
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_TRUE(onRejected.isEmpty());
- isolate()->RunMicrotasks();
+ v8::MicrotasksScope::PerformCheckpoint(isolate());
EXPECT_TRUE(onFulfilled.isEmpty());
EXPECT_FALSE(onRejected.isEmpty());

Powered by Google App Engine
This is Rietveld 408576698