Index: third_party/grpc/test/core/support/log_test.c |
diff --git a/third_party/WebKit/Source/core/dom/MutationCallback.h b/third_party/grpc/test/core/support/log_test.c |
similarity index 65% |
copy from third_party/WebKit/Source/core/dom/MutationCallback.h |
copy to third_party/grpc/test/core/support/log_test.c |
index 28cebe3c0e6f47c26f5ca348698904f9b90395cb..b39b0699134199ba6d68c61426ca8244c5d910be 100644 |
--- a/third_party/WebKit/Source/core/dom/MutationCallback.h |
+++ b/third_party/grpc/test/core/support/log_test.c |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2011 Google Inc. All rights reserved. |
+ * |
+ * Copyright 2015, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,29 +28,32 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#ifndef MutationCallback_h |
-#define MutationCallback_h |
- |
-#include "platform/heap/Handle.h" |
-#include "wtf/Vector.h" |
- |
-namespace blink { |
- |
-class MutationRecord; |
-class MutationObserver; |
- |
-class MutationCallback : public GarbageCollectedFinalized<MutationCallback> { |
-public: |
- virtual ~MutationCallback() { } |
- |
- virtual void call(const HeapVector<Member<MutationRecord>>&, MutationObserver*) = 0; |
- virtual ExecutionContext* getExecutionContext() const = 0; |
- |
- DEFINE_INLINE_VIRTUAL_TRACE() { } |
-}; |
- |
-} // namespace blink |
- |
-#endif // MutationCallback_h |
+#include <grpc/support/log.h> |
+ |
+#include <string.h> |
+ |
+#include "test/core/util/test_config.h" |
+ |
+static void test_callback(gpr_log_func_args *args) { |
+ GPR_ASSERT(0 == strcmp(__FILE__, args->file)); |
+ GPR_ASSERT(args->severity == GPR_LOG_SEVERITY_INFO); |
+ GPR_ASSERT(0 == strcmp(args->message, "hello 1 2 3")); |
+} |
+ |
+int main(int argc, char **argv) { |
+ grpc_test_init(argc, argv); |
+ /* test logging at various verbosity levels */ |
+ gpr_log(GPR_DEBUG, "%s", "hello world"); |
+ gpr_log(GPR_INFO, "%s", "hello world"); |
+ gpr_log(GPR_ERROR, "%s", "hello world"); |
+ /* should succeed */ |
+ GPR_ASSERT(1); |
+ gpr_set_log_function(test_callback); |
+ gpr_log_message(GPR_INFO, "hello 1 2 3"); |
+ gpr_log(GPR_INFO, "hello %d %d %d", 1, 2, 3); |
+ /* TODO(ctiller): should we add a GPR_ASSERT failure test here */ |
+ return 0; |
+} |