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

Unified Diff: third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Addressed win failure Created 4 years, 3 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/core/testing/CallbackFunctionTest.cpp
diff --git a/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp b/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..094dc0ea81f1872dd48f2caf4bae67338d9a19c0
--- /dev/null
+++ b/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/testing/CallbackFunctionTest.h"
+
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "bindings/core/v8/V8TestCallback.h"
+
+namespace blink {
+
+DEFINE_TRACE(CallbackFunctionTest)
+{
+}
+
+String CallbackFunctionTest::testCallback(ScriptState* scriptState, V8TestCallback* callback, const String& msg1, const String& msg2, ExceptionState& exceptionState)
haraken 2016/09/20 07:08:22 msg => message Blink prefers a fully qualified na
lkawai 2016/09/20 08:15:07 Done.
+{
+ ScriptWrappable* scriptWrappable = nullptr;
haraken 2016/09/20 07:08:22 This variable is redundant. You can directly pass
lkawai 2016/09/20 08:15:07 Done.
+ String returnValue;
+
+ if (callback->call(scriptState, scriptWrappable, msg1, msg2, returnValue)) {
+ return String("SUCCESS: ") + returnValue;
+ }
+ return String("Error!");
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698