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

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

Issue 2144413004: Removes abuse of createClosure() from ScriptPromiseTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7146ae52bb7f5875f4343a7e35da23b3a4499a0c..a4d9df33f9ecbfe283a9b178c3d68cf5cf7a34b1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
@@ -46,8 +46,6 @@ namespace {
typedef ScriptPromise::InternalResolver Resolver;
-void callback(const v8::FunctionCallbackInfo<v8::Value>& info) { }
-
class Function : public ScriptFunction {
public:
static v8::Local<v8::Function> createFunction(ScriptState* scriptState, ScriptValue* output)
@@ -83,9 +81,6 @@ public:
~TryCatchScope()
{
- // FIXME: We put this statement here to clear an exception from the isolate.
- createClosure(callback, v8::Undefined(m_isolate), m_isolate);
-
// Execute all pending microtasks
v8::MicrotasksScope::PerformCheckpoint(m_isolate);
}
@@ -116,6 +111,11 @@ TEST(ScriptPromiseTest, constructFromNonPromise)
ScriptPromise promise(scope.getScriptState(), v8::Undefined(scope.isolate()));
ASSERT_TRUE(tryCatchScope.hasCaught());
ASSERT_TRUE(promise.isEmpty());
+
+ // TODO(yukishiino): We put this statement here to clear an exception from
+ // the isolate. Otherwise, the leak detector complains. Really mysterious
+ // hack.
+ v8::Function::New(scope.context(), nullptr);
haraken 2016/07/21 13:28:28 I'd add this to the destructor of V8TestingScope.
Yuki 2016/07/22 09:10:31 Done.
}
TEST(ScriptPromiseTest, thenResolve)
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698