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

Unified Diff: Source/core/testing/Internals.cpp

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 3f88666cfba22a41c3ed8ee49819cb87e86e5e4d..76ba5d0778c5588d98669cc3166f7d57a5f51144 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -2429,6 +2429,24 @@ ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis
return promise.then(AddOneFunction::create(context));
}
+ScriptPromise Internals::promiseCheck(ExecutionContext* context, long arg1, bool arg2, const Dictionary& arg3, const String& arg4, ExceptionState& es)
+{
+ if (arg2)
+ return ScriptPromise::cast(v8String(toIsolate(context), "done"), toIsolate(context));
+ es.throwDOMException(InvalidStateError, "Thrown from the native implementation.");
+ return ScriptPromise();
+}
+
+ScriptPromise Internals::promiseCheckWithoutExceptionState(ExecutionContext* context, const Dictionary& arg1, const String& arg2, const Vector<String>& arg3)
+{
+ return ScriptPromise::cast(v8String(toIsolate(context), "done"), toIsolate(context));
+}
+
+ScriptPromise Internals::promiseCheckRange(ExecutionContext* context, long arg1)
+{
+ return ScriptPromise::cast(v8String(toIsolate(context), "done"), toIsolate(context));
+}
+
void Internals::trace(Visitor* visitor)
{
visitor->trace(m_frontendWindow);

Powered by Google App Engine
This is Rietveld 408576698