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

Unified Diff: third_party/grpc/test/core/support/log_test.c

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: 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;
+}
« no previous file with comments | « third_party/grpc/test/core/support/load_file_test.c ('k') | third_party/grpc/test/core/support/murmur_hash_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698